#include<bits/stdc++.h>
using namespace std;
struct p{
int x,y;
}a[1005];
bool cmp(p a,p b){
return a.x<b.x;
}
int main(){
int s,n;
cin>>s>>n;
for(int i=0;i<n;i++){
cin>>a[i].x>>a[i].y;
}
sort(a,a+n,cmp);
for(int i=0;i<n;i++){
if(s<=a[i].x) {
cout<<"NO\n";
return 0;
}
s = s+ a[i].y;
}
cout<<"YES\n";
return 0;
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCnN0cnVjdCBwewogICAgaW50IHgseTsKfWFbMTAwNV07Cgpib29sIGNtcChwIGEscCBiKXsKICAgIHJldHVybiBhLng8Yi54Owp9CgppbnQgbWFpbigpewoKICAgIGludCBzLG47CiAgICBjaW4+PnM+Pm47CgogICAgZm9yKGludCBpPTA7aTxuO2krKyl7CiAgICAgICAgY2luPj5hW2ldLng+PmFbaV0ueTsKICAgIH0KCiAgICBzb3J0KGEsYStuLGNtcCk7CgogICAgZm9yKGludCBpPTA7aTxuO2krKyl7CiAgICAgICAgaWYoczw9YVtpXS54KSB7CiAgICAgICAgICAgIGNvdXQ8PCJOT1xuIjsKICAgICAgICAgICAgcmV0dXJuIDA7CiAgICAgICAgfQoKICAgICAgICBzICA9IHMrIGFbaV0ueTsKCiAgICB9CgogICAgY291dDw8IllFU1xuIjsKCgogICAgcmV0dXJuIDA7Cgp9