#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define fastio                        \
    ios_base::sync_with_stdio(false); \
    cin.tie(0);                       \
    cout.tie(0)
#define scl(n) scanf("%lld", &n)
#define pcl(n) printf("%lld\n", n)
#define pcl1(n) printf("%lld ", n)
#define nln printf("\n")
#define dev(x) cout << #x << " " << x << " ";
#define PTT pair<ll, ll>

map<ll, ll> mp, mp1;
map<ll, ll>::iterator itr;

int main()
{
    ll t, n, k, x, m;
    vector<PTT> v;
    scl(n);
    scl(m);
    scl(t);
    PTT p;
    for (int i = 0; i < m; i++)
    {
        scl(p.first);
        scl(p.second);
        v.push_back(p);
    }
    ll charge = n, tmp = 0;
    bool bl = true;
    for (int i = 0; i < m; i++)
    {
        charge -= (v[i].first - tmp);
        if (charge <= 0)
        {
            bl = false;
        }

        //cout << charge << " ";
        charge += (v[i].second - v[i].first);
        if (charge >= n)
        {
            charge = n;
        }

        //cout << charge << endl;
        tmp = v[i].second;
    }
    charge -= (t - tmp);
    if (charge <= 0)
    {
        bl = false;
    }
    if (bl)
    {
        puts("Yes");
    }
    else
    {
        puts("No");
    }

    return 0;
}

#include<iostream>
#include<vector>
#include<map>
#include<stack>
#include<set>
#include<queue>
#include<stdlib.h>
#include<math.h>
#include<string>
#include<string.h>
#include<algorithm>
#include<iomanip>
#include<sstream>
#define endl "\n"
#define Doura() ios_base::sync_with_stdio(false),cin.tie(NULL), cout.tie(NULL)
#define ll long long
using namespace std;
const long long MXX=1e7;
int a[MXX],b[MXX];
void kajelag()
{
     int n;
     cin>>n;
     for(int i=0;i<n;i++)
          cin>>a[i];
     for(int i=0;i<n;i++)
          cin>>b[i];
     sort(a,a+n);
     sort(b,b+n);
     //cout<<b[0]<<" "<<a[n-1]<<endl;
     int ans=b[0]-a[n-1];

     if(ans<0)
          cout<<0<<endl;
     else cout<<ans+1<<endl;
}
int main()
{
      Doura();
     #ifndef ONLINE_JUDGE
          //   freopen("input.txt","r",stdin);
          //   freopen("output.txt","w",stdout);
     #endif // ONLINE_JUDGE

     int t;
     //cin>>t;
     //while(t--)
     {
          kajelag();
     }
     return 0;
}
