#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;
using ll = long long;
using ld = long double;

#define all(x)  x.begin(),x.end()
#define v(x) vector<x>
#define nl '\n'
#define fxd(x) fixed << setprecision(x)
template<class t> using ordered_set = tree<t, null_type, less<t>, rb_tree_tag, tree_order_statistics_node_update>;
template<class t> using ordered_multiset = tree<t, null_type, less_equal<t>, rb_tree_tag, tree_order_statistics_node_update>;


bool cmp(pair<ll,ll>& a ,pair<ll,ll>& b)
{
    if(a.first == b.first)
    {
        return (b.second > a.second);
    }
    else
    {
        return (a.first < b.first);
    }
}

int main()
{
    ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
    int s , n ; cin >> s >> n;
    vector<pair<ll,ll>> dragon(n);
    for (int i = 0; i < n; i++)
    {
        cin >> dragon[i].first >> dragon[i].second;
    }
    sort(dragon.begin(),dragon.end(),cmp);
    
    for (int i = 0; i < n; i++)
    {
        if(s > dragon[i].first)
        {
            s+= dragon[i].second;
        }
        else
        {
            cout << "NO";
            return 0;
        }
    }
    cout << "YES";
}