Create SCU's closet

Description
Summer comes with the hot weather.Today xiaoL wants to take the heavy coats in her closet out and bring her T-shirts and skirts in.We have konwn that the volume of SCU's closet is V units,xiaoL has N pieces of clothing to put in,each of them needs Ai units of space.When putting the i-th clothes into the closet,she finds that she needs Bi units of space to ensure the i-th clothes will be placed well.After that,the volume of the closet will decrease by Ai.Now,She wonders whether she can move all her clothes into the closet.
Input
There are multiple test cases,for each case,the first line contains 2 integers:V,N,then followed N lines,each of them contains 2 integers Ai and Bi as descriped above.
( 0 < V < 10000, 0 < N<  1000, 0 < Ai < V, Ai <= Bi < 1000 )
Output
For each test case output "YES" if she can put all her clothes into the closet or else output "NO"
Sample Input
20 3
10 20
3 10
1 7
10 2
1 10
2 11
Sample Output
YES
NO
Author
lentty