// include
#include <bits/stdc++.h>

using namespace std;

// conversion
inline int toInt(string s) {
  int v;
  istringstream sin(s);
  sin >> v;
  return v;
}
template <class T>
inline string toString(T x) {
  ostringstream sout;
  sout << x;
  return sout.str();
}
// change
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return true;
  }
  return false;
}
// math
template <class T>
inline T sqr(T x) {
  return x * x;
}

template <class T>
inline T nCr(T n, T r) {
  T num = 1;
  for (int i = 1; i <= r; ++i) {
    num *= (n - i + 1) / i;
  }
  return num;
}
template <class T>
inline T nPr(T n, T r) {
  r = n - r;
  T sum = 1;
  int i;
  for (i = n; i >= r + 1; --i) sum *= i;
  return sum;
}

template <class T>
inline T facctorial(T k) {
  T sum = 1;
  for (int i = 1; i <= k; ++i) {
    sum *= i;
  }
  return sum;
}
// numeric
template <class T>
inline T gcd(T a, T b) {
  if (a < b) {
    a ^= b;
    b ^= a;
    a ^= b;
  }

  return b ? gcd(b, a % b) : a;
}

template <class T>
inline T lcm(T a, T b) {
  return a * b / gcd(a, b);
}
// typedef
using VI = vector<int>;
using VVI = vector<VI>;
using VS = vector<string>;
using PII = pair<int, int>;
using LL = int64_t;

// container util
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define SZ(a) static_cast<int>((a).size())
#define EACH(i, c) \
  for (typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define EXIST(s, e) ((s).find(e) != (s).end())

// repetition
#define FOR(i, a, b) for (int i = (a); i <= static_cast<int>(b); ++i)
#define REP(i, n) FOR(i, 0, n)

// constant
constexpr double EPS = 1e-10;
const double PI = acos(-1.0);
constexpr LL INF = 1e10;

// clear memory
#define CLR(a) memset((a), 0, sizeof(a))

// debug
#define dump(x) cerr << #x << " = " << (x) << endl;
#define debug(x)                                         \
  cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" \
       << " " << __FILE__ << endl;

int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, s, d;
  cin >> n >> s >> d;
  vector<PII> p(n);
  VI x(n), y(n);
  REP(i, n) { cin >> p[i].first >> p[i].second; }
  sort(ALL(p));
  REP(i, n) {
    if (p[i].first < s && p[i].second > d) {
      cout << "Yes"
           << "\n";
      return 0;
    }
  }
  cout << "No"
       << "\n";
  return 0;
}


#include <bits/stdc++.h>

using namespace std;
#define ll long long
typedef pair<ll,ll> ii;
const ll inf=1e15;

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    ll n,tot,nextVil=-1;
    priority_queue<ii,vector<ii>,greater<ii>> pq;
    cin>>n>>tot;
    ll a,b;
    for (int i=0;i<n;i++){
        cin>>a>>b;
        pq.push(make_pair(a,b));
    }
    ll y=0; // b is yen friend gives
    ll cnt=0;
    while (cnt<n && tot>=nextVil){
        tot+=y;
        nextVil=pq.top().first;
        y=pq.top().second;
        pq.pop();
        cnt++;
    }
    cout<<tot+((tot>=nextVil)?y:0);

    return 0;
}