#include <bits/stdc++.h>
#define ll long long
#define ls id << 1
#define rs id << 1 | 1
#define mem(array, value, size, type) memset(array, value, ((size) + 5) * sizeof(type))
#define memarray(array, value) memset(array, value, sizeof(array))
#define fillarray(array, value, begin, end) fill((array) + (begin), (array) + (end) + 1, value)
#define fillvector(v, value) fill((v).begin(), (v).end(), value)
#define pb(x) push_back(x)
#define st(x) (1LL << (x))
#define pii pair<int, int>
#define mp(a, b) make_pair((a), (b))
#define Flush fflush(stdout)
#define vecfirst (*vec.begin())
#define veclast (*vec.rbegin())
#define vecall(v) (v).begin(), (v).end()
#define vecupsort(v) (sort((v).begin(), (v).end()))
#define vecdownsort(v, type) (sort(vecall(v), greater<type>()))
#define veccmpsort(v, cmp) (sort(vecall(v), cmp))
using namespace std;
const int N = 500050;
const int inf = 0x3f3f3f3f;
const ll llinf = 0x3f3f3f3f3f3f3f3f;
const int mod = 998244353;
const int MOD = 1e9 + 7;
const double PI = acos(-1.0);
clock_t TIME__START, TIME__END;
void program_end()
{
#ifdef ONLINE
    printf("\n\nTime used: %.6lf(s)\n", ((double)TIME__END - TIME__START) / 1000);
    system("pause");
#endif
}
ll r1, c1, r2, c2;

inline void solve()
{
    cin >> r1 >> c1 >> r2 >> c2;
    if (r1 == r2 && c1 == c2)
        return puts("0"), void();
    if ((r1 + c1 == r2 + c2) || (r1 - c1 == r2 - c2) || (abs(r1 - r2) + abs(c1 - c2) <= 3))
        return puts("1"), void();
    if (((r1 + c1) % 2 == (r2 + c2) % 2) || (abs(r1 - r2) + abs(c1 - c2) <= 6))
        return puts("2"), void();
    if (abs(r1 - r2) <= abs(c1 - c2))
    {
        int ans = min(abs(c1 - abs(r1 - r2) - c2), abs(c1 + abs(r1 - r2) - c2));
        if (ans <= 3)
            return puts("2"), void();
    }
    else
    {
        int ans = min(abs(r1 - abs(c1 - c2) - r2), abs(r1 + abs(c1 - c2) - r2));
        if (ans <= 3)
            return puts("2"), void();
    }

    puts("3");
}

int main()
{
    TIME__START = clock();
    int Test = 1;
    // scanf("%d", &Test);
    while (Test--)
    {
        solve();
        // if (Test)
        //     putchar('\n');
    }
    TIME__END = clock();
    program_end();
    return 0;
}
#include <iostream>
#include <string>
#include <vector>
#include <algorithm> 
#include <utility> 
#include <tuple> 
#include <cstdint> 
#include <cstdio> 
#include <map> 
#include <queue> 
#include <set> 
#include <stack> 
#include <deque> 
#include <unordered_map> 
#include <unordered_set> 
#include <bitset> 
#include <cctype> 
#include <cmath>
#include <iomanip>
#include <ctype.h>

using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi >;
using vl = vector<ll>;
using vvl = vector<vl >;
using pairi = pair<int, int>;
using pairl = pair<ll, ll>;

#define TR ","
#define TS " "
#define rep(i,N) for(ll i=0;i<(ll)N;++i)
#define rpt(i,a,b) for(ll i=a;i<(ll)b;++i)
#define all(v) v.begin(), v.end()
#define IO ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)

ll gcd(ll a, ll b) {
    if (a < b) swap(a, b);
    if (b == 0) return a;
    return gcd(b, a % b);
}

ll lcm(ll x, ll y) {
    return x / gcd(x, y) * y;
}

void printVector(const vector<ll>& vec) {
    for (ll value : vec) {
        cout << value << " ";
    }
    cout << endl;
}

vector<int> IntegerToVector(int bit, int N) {
    vector<int> S;
    for (int i = 0; i < N; ++i) {
        if (bit & (1 << i)) {
            S.push_back(i);
        }
    }
    return S;
}

const int MAXN = 510000;
const int MOD = 1000000007;

long long fac[MAXN], finv[MAXN], inv[MAXN];

void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (ll i = 2; i < MAXN; i++) {
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

ll COM(ll n, ll k) {
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

int main() {
    
    ll N, M, T;
    cin >> N >> M >> T;
    vi a(M), b(M);

    ll y = N;

    rep(i, M) cin >> a[i] >> b[i];
    if (N <= a[0]) { cout << "No" << endl; return 0; }
    y -= a[0];

    rep(i, M-1) {
        y = min(N, y + b[i] - a[i]);
        if(y<=a[i+1]-b[i]) { cout << "No" << endl; return 0; }
        y -= a[i + 1] - b[i];
    }

    y = min(N, y + b[M-1] - a[M-1]);
    if (y <= T - b[M-1]) { cout << "No" << endl; return 0; }
    
    cout << "Yes" << endl; return 0;

}