// Containers
#include <deque>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <vector>

// #include "conf.d/say.h"
using namespace std;
#define ll long long
#define pb push_back
#define mp make_pair
#define INF 0x3F3F3F3F
#define all(v) v.begin(), v.end()
#define f first
#define s second
#define MOD 1000000007
#define vt(T) vector<T>

#define FOR(i, n) for (int i = 0; i < n; i++)
#define FORUP(i, a, b) for (int i = a; i < b; i++)
#define FORDOWN(i, a, b) for (int i = a; i > b; --i)
#define EACH(e, C) for (auto &e : C)
#define len(v) (int)v.size()
#define PQ(type) priority_queue<type>
#define PQD(type) priority_queue<type, vector<type>, greater<type>>
#define US unordered_set
#define UM unordered_map

typedef map<int, int> mii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> pii;
typedef pair<int, pair<int, int>> pipii;
typedef vector<pii> vpii;

template <class T> bool in(const T e, unordered_set<T> s) {
  return s.count(e) > 0;
}
template <class T> bool in(const T e, set<T> s) { return s.count(e) > 0; }
template <class K, class V> bool in(const K e, unordered_map<K, V> s) {
  return s.count(e) > 0;
}
template <class K, class V> bool in(const K e, map<K, V> s) {
  return s.count(e) > 0;
}

int dirs[5] = {-1, 0, 1, 0, -1};

// fast IO
static auto __2333__ = []() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  return 0;
}();
// --------------------------------------------------------

int main() {
  int N;
  cin >> N;
  ll res = 0;
  FOR(i, N) {
    int a, b;
    cin >> a >> b;
    res += (ll)(b + a) * (1 + b - a) / 2;
  }
  cout << res << endl;
}
#include<bits/stdc++.h>
#define mod 1000000007
#define INF 10000000000000001
#define F first
#define S second
#define LB lower_bound
#define UB upper_bound
#define vc vector
#define vll vector<long long>
#define pll pair<long long,long long>
#define pb push_back
#define all(v) v.begin(),v.end()
#define T ll test;cin>>test; while(test--)
#define rep(i,a,n) for(ll i=a;i<(long long)n;++i)
#define repr(i,n,a) for(ll i=n;i>(long long)a;--i)
#define MAX 200005
#define sz(x) (ll)x.size()
#define ins insert
#define mp make_pair
#define int  long long
typedef  long long ll;
typedef long double ld;
using namespace std;


signed main()
{
  ios_base::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);
  ll pre[MAX];
  memset(pre,0,sizeof(pre));
  ll n,w;
  cin>>n>>w;
  ll s,t,p;
  rep(i,0,n)
  {
  	cin>>s>>t>>p;
  	pre[s]+=p;
  	pre[t]-=p;
  }
  ll f=0;
  if(pre[0]>w) f=1;
  rep(i,1,MAX)
  {
  	pre[i]+=pre[i-1];
  	if(pre[i]>w) f=1;
  }
  if(f) cout<<"No\n";
  else cout<<"Yes\n";
}