#include <iostream>
#include <string>
using namespace std;

int main() {
  int a, b;
  cin >> a >> b;
  int a1 = a / 100, b1 = b / 100;
  int a2 = (a -= a1*100) / 10, b2 = (b -= b1*100) / 10;
  int a3 = a - a2*10, b3 = b - b2*10;
  a = a1 + a2 + a3, b = b1 + b2 + b3;
  if(a >= b) cout << a << endl;
  else cout << b << endl;
  return 0;
}

#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <utility>
#include <algorithm>
#include <cmath>
#include <climits>
#include <iomanip>
#include <queue>
#include <stack>

using namespace std;

typedef long long ll;

const int INF = (1<<30)-1;
const ll LINF = 1e18;

#define rep(i, n) for (int i = 0; i < n; i++)

template<class T> 
bool chmax(T &a, T b) {if (a < b) {a = b;return true;}else return false;}

template<class T> 
bool chmin(T &a, T b) {if (a > b) {a = b;return true;}else return false;}

int main() {
    ll n, m, t; cin >> n >> m >> t;
    ll tmp = n;
    vector<ll> a(m+1), b(m+1, 0);
    rep(i, m) {
        cin >> a[i+1] >> b[i+1];
        tmp -= a[i+1] - b[i];
        if (tmp <= 0) {
            cout << "No" << endl;
            return 0;
        }
        tmp = min(n, tmp+b[i+1]-a[i+1]);
    }
    
    tmp -= t - b[m];
    if (tmp <= 0) {
        cout << "No" << endl;
        return 0;
    }
    cout << "Yes" << endl;
    return 0;
}

//小数点精度
//cout << fixed << std::setprecision(15) << y << endl;