Date
Time limit2sMemory limit1024 MB
Given a meal cost k and Edward's bills, decide whether the sum still reaches k after removing the largest bill.
- Level
Easy2 of 10
- Topics
- Array, Implementation
- Solved
- No attempts yet
Problem
Edward and Bella went on a date at the restaurant "Stefani's". This restaurant always serves the same set of dishes for a fixed price.
When Edward put down the money and went to powder his nose, Bella wondered whether he meant to pay for her too. When Edward wants to pay only for himself, he puts down a set of bills such that removing any single bill leaves a sum less than the cost of the meal. The opposite case means he also meant to pay for Bella.
Bella is bad at mental arithmetic, so she asks you to help her.
Input
The first line contains the cost of the meal (). The second line contains the number of bills () that Edward put down. The next line contains integers (), the values of the bills.
Output
Print "YES" if Edward is definitely going to pay for Bella, and "NO" otherwise.