#include <bits/stdc++.h>
using namespace std;

typedef long long int ll;
#define deb(x) cout << #x << " " << x << endl;
#define debtwo(x,y) cout << x << ", " << y << endl;
#define mod 1000000007
#define N 1000001

void solve() {
	ll n, m, t, a, b, pre = 0;
	cin >> n >> m >> t;
	ll lim = n;

	bool f = 0;

	while (m--) {
		cin >> a >> b;
		n -= (a - pre);
		if (n <= 0) {
			f = 1;
		}
		n = min(lim, n + b - a);
		pre = b;
	}
	if (f) {
		cout << "No\n";
		return;
	}
	n -= (t - pre);

	if (n <= 0) {
		cout << "No\n";
		return;
	}
	cout << "Yes\n";
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

	ll t = 1;
	//cin >> t;

	while (t--) {
		solve();
	}
}
#include <bits/stdc++.h>
using namespace std;
#define gc getchar_unlocked
#define fo(a, n) for (int i = a; i < n; i++)
#define Fo(k, n) for (int i = k; k < n ? i < n : i > n; k < n ? i += 1 : i -= 1)
#define ll long long
#define si(x) scanf("%d", &x)
#define sl(x) scanf("%lld", &x)
#define ss(s) scanf("%s", s)
#define pi(x) printf("%d\n", x)
#define pl(x) printf("%lld\n", x)
#define ps(s) printf("%s\n", s)
#define deb(x) cout << #x << "=" << x << endl
#define deb2(x, y) cout << #x << "=" << x << "," << #y << "=" << y << endl
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define clr(x) memset(x, 0, sizeof(x))
#define sortall(x) sort(all(x))
#define tr(it, a) for (auto it = a.begin(); it != a.end(); it++)
#define PI 3.1415926535897932384626
typedef pair<int, int> pii;
typedef pair<ll, ll> pl;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<pii> vpii;
typedef vector<pl> vpl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
const int mod = 1'000'000'007;
const int N = 3e5, M = N;
//=======================

void solve()
{
    ll n;
    cin >> n;
    ll a, b{}, c, mini{INT64_MAX};
    ll i = 0;
    while (pow(2, i) <= n)
    {
        ll d = pow(2, i);
        c = n % d;
        b = i;
        a = n / pow(2, i);
        mini = min(mini, a + b + c);
        i++;
    }
    cout << mini << endl;
}

int main()
{
    ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);

    int t = 1;
    while (t--)
    {
        solve();
    }

    return 0;
}