#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;
typedef vector<pll> vpll;
typedef vector<bool> vbl;
typedef vector<vector<bool>> vvbl;

void INX(){}
template<typename Head, typename... Tail>
void INX(Head&& head, Tail&&... tail)
{
    cin >> head;
    INX(forward<Tail>(tail)...);
}
void OUTX(){}
template<typename Head, typename... Tail>
void OUTX(Head&& head, Tail&&... tail)
{
    cout << head << endl;
    OUTX(forward<Tail>(tail)...);
}
void OUTX2(){cout << endl;}
template<typename Head, typename... Tail>
void OUTX2(Head&& head, Tail&&... tail)
{
    cout << head << ' ';
    OUTX2(forward<Tail>(tail)...);
}

#define ADD emplace_back
#define MP make_pair
#define VVEC(type) vector<vector<type>>
#define __LONG_LONG_MIN__ (-__LONG_LONG_MAX__ - 1)

//#define MOD 1000000007 // 10^9 + 7
//setprecision(10)

// Least Significant Bit (LSB)
ll LSB(ll x)
{
    return x & (-x);
}

// Most Significant Bit (MSB)
ll MSB(ll x)
{
    if(x == 0) return x;

    ll cnt = 0;
    while(x)
    {
        cnt++;
        x >>= 1;
    }
    return 1 << (cnt - 1);
}

// 参考：https://www.slideshare.net/hcpc_hokudai/binary-indexed-tree

// Binary Indexed Tree (BIT)
// フェニック木
class BinaryIndexedTree
{
    private:
    ll N; // 要素数
    vll data; // 実体のデータ

    // コンストラクタ共通の初期化処理
    void initial(ll n, ll initialvalue = 0)
    {
        N = n;
        ll msb = MSB(n);
        data.resize((msb == n ? n : MSB(n) << 1) + 1, initialvalue);
    }

    public:
    // コンストラクタ
    BinaryIndexedTree(ll n, ll initialvalue = 0)
    {
        initial(n, initialvalue);
    }

    // a[i]にxを足す(i=1,2,...,N)
    void AddValue(ll i, ll x)
    {
        while(i < (ll)data.size())
        {
            data[i] += x;
            i += LSB(i);
        }
    }

    // a[1]からa[i]までの累積和
    ll GetCumulativeSum(ll i)
    {
        ll result = 0;
        while(i)
        {
            result += data[i];
            i ^= LSB(i);
        }
        return result;
    }

    // a[i]からa[j]までの部分和
    ll GetPartialSum(ll i, ll j)
    {
        return GetCumulativeSum(j) - GetCumulativeSum(i - 1);
    }
};

// 公式解説を参考に実装
int main()
{
    ll N;
    INX(N);
    
    vll a(N);
    for (ll i = 0; i < N; i++)
    {
        INX(a[i]);
    }

    ll result = 0;
    BinaryIndexedTree bitt(N);
    for(ll x : a)
    {
        result += bitt.GetPartialSum(x + 1, N);
        bitt.AddValue(x + 1, 1);
    }
    for(ll x : a)
    {
        OUTX(result);
        result += N - (1 + 2 * x);
    }


    return 0;
}

#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vb=vector<bool>;
using vvb=vector<vb>;
using vd=vector<double>;
using vvd=vector<vd>;
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using pll=pair<ll,ll>;
using tll=tuple<ll,ll>;
using tlll=tuple<ll,ll,ll>;
using vs=vector<string>;
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rep(i,n) range(i,0,n)
#define rrep(i,n) for(ll i=((ll)n)-1;i>=0;i--)
#define range(i,a,n) for(ll i=((ll)a);i<((ll)n);i++)
#define LINF ((ll)1ll<<60)
#define INF ((int)1<<30)
#define EPS (1e-9)
#define MOD (1000000007ll)
#define fcout(a) cout<<setprecision(a)<<fixed
#define fs first
#define sc second
#define PI (3.1415926535897932384)

int dx[]={1,0,-1,0,1,-1,-1,1},dy[]={0,1,0,-1,1,1,-1,-1};
template<class T>bool chmax(T&a,T b){if(a<b){a=b; return true;}return false;}
template<class T>bool chmin(T&a,T b){if(a>b){a=b; return true;}return false;}
template<class S>S sum(vector<S>&a){return accumulate(all(a),S());}
template<class S>S max(vector<S>&a){return *max_element(all(a));}
template<class S>S min(vector<S>&a){return *min_element(all(a));}
ll max(int a,ll b){return max((ll)a,b);} ll max(ll a,int b){return max(a,(ll)b);}
int sgn(const double&r){return (r>EPS)-(r<-EPS);} // a>0  : sgn(a)>0
int sgn(const double&a,const double&b){return sgn(a-b);} // b<=c : sgn(b,c)<=0

template<class T>void puta(T&&t){cout<<t<<"\n";}
template<class H,class...T>void puta(H&&h,T&&...t){cout<<h<<' ';puta(t...);}
template<class S,class T>void tf(bool b,S t,T f){if(b)puta(t);else puta(f);}
void YN(bool b){tf(b,"YES","NO");}
void Yn(bool b){tf(b,"Yes","No");}
void yn(bool b){tf(b,"yes","no");}
template<class S,class T>ostream&operator<<(ostream&os,pair<S,T>p){os<<"["<<p.first<<", "<<p.second<<"]";return os;};
template<class S>auto&operator<<(ostream&os,vector<S>t){bool a=1;for(auto s:t){os<<(a?"":" ")<<s;a=0;}return os;}
template<class S>auto&operator>>(istream&is,vector<S>&t){for(S&a:t)cin>>a;return is;}

/*他のライブラリを入れる場所*/


int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll mv,v,n,l,t=0;
    cin>>v>>n>>l;
    mv=v;
    rep(i,n){
        ll a,b; cin>>a>>b;
        v-=(a-t);
        if(v<=0){
            Yn(0);
            return 0;
        }
        v+=b-a;
        v=min(v,mv);
        t=b;
    }
    Yn(v>(l-t));

    return 0;
}