#include<bits/stdc++.h>
using namespace std;
const int N=200005;
struct st{
long long s,t;
bool operator<(const st &y)
{
return t<y.t;
}
}q[N];
long long a[N],b[N],s[N],t[N];
int n;
vector<pair<int,int> >sg;
vector<int>p;
bool sp[N],F;
void process(const int l,const int r)
{
if(a[l]<=b[l])
return;
long long d=a[r];
for(int i=l;i<=r;++i)
a[i]=-a[i],b[i]=-b[i];
reverse(a+l,a+r+1),reverse(b+l,b+r+1),reverse(t+l,t+r+1);
for(int i=l;i<=r;++i)
a[i]+=d,b[i]+=d;
}
void init()
{
for(int i=2;i<=n;++i)
if(min(a[i],b[i])>max(a[i-1],b[i-1]))
sp[i]=1;
sg.clear();
int ft=1;
for(int i=2;i<=n;++i)
if(sp[i])
sg.emplace_back(ft,i-1),ft=i;
sg.emplace_back(ft,n);
for(pair<int,int> i:sg)
process(i.first,i.second);
}
namespace seg{
long long v[N*4],mx[N*4],tag[N*4];
bool is[N*4];
int L[N*4],R[N*4];
void pushup(const int k)
{
v[k]=v[2*k]+v[2*k+1],mx[k]=max(mx[k*2],mx[k*2+1]);
}
void pushdown(const int k)
{
if(is[k])
{
is[k]=0,is[2*k]=is[2*k+1]=1;
tag[2*k]=tag[2*k+1]=tag[k];
mx[2*k]=mx[2*k+1]=tag[k];
v[2*k]=tag[k]*(R[2*k]-L[2*k]+1)+1LL*(R[2*k]-L[2*k]+1)*(R[2*k]+L[2*k])/2;
v[2*k+1]=tag[k]*(R[2*k+1]-L[2*k+1]+1)+1LL*(R[2*k+1]-L[2*k+1]+1)*(R[2*k+1]+L[2*k+1])/2;
}
}
void build(const int l,const int r,const int k=1)
{
L[k]=l,R[k]=r,tag[k]=v[k]=0,is[k]=0;
if(l<r)
build(l,l+r>>1,k*2),build(l+r+2>>1,r,k*2+1),pushup(k);
else
v[k]=a[l],mx[k]=a[l]-l;
}
int find(const int l,const int r,const long long d,const int k=1)
{
if(L[k]>r||R[k]<l)
return r+1;
if(L[k]>=l&&R[k]<=r)
{
if(mx[k]<d)
return r+1;
if(L[k]==R[k])
return L[k];
pushdown(k);
if(mx[k*2]>=d)
return find(l,r,d,k*2);
else
return find(l,r,d,k*2+1);
}
pushdown(k);
int u=find(l,r,d,k*2);
if(u<=r)
return u;
else
return find(l,r,d,k*2+1);
}
long long query(const int l,const int r,const int k=1)
{
if(L[k]>r||R[k]<l)
return 0;
if(L[k]>=l&&R[k]<=r)
return v[k];
pushdown(k);
return query(l,r,k*2)+query(l,r,k*2+1);
}
void update(const int l,const int r,const long long d,const int k=1)
{
if(L[k]>r||R[k]<l)
return;
if(L[k]>=l&&R[k]<=r)
{
mx[k]=tag[k]=d,is[k]=1;
v[k]=tag[k]*(R[k]-L[k]+1)+1LL*(R[k]-L[k]+1)*(R[k]+L[k])/2;
return;
}
pushdown(k);
update(l,r,d,k*2),update(l,r,d,k*2+1);
pushup(k);
}
}
bool cmp(const int x,const int y)
{
return t[x]<t[y];
}
void calc(const int l,const int r)
{
p.clear();
for(int i=l;i<=r;++i)
p.push_back(i);
sort(p.begin(),p.end(),cmp);
int pos;
long long ans;
for(int i:p)
{
pos=seg::find(i,r,b[i]-i);
if(pos>i)
ans=1LL*(pos-i)*(b[i]+b[i]+pos-i-1)/2-seg::query(i,pos-1);
else
ans=0;
q[i]=st{ans,t[i]};
seg::update(i,pos-1,b[i]-i);
}
}
void solve()
{
cin>>n;
for(int i=1;i<=n;++i)
cin>>a[i]>>b[i]>>t[i],sp[i]=0;
init();
seg::build(1,n);
for(pair<int,int> i:sg)
calc(i.first,i.second);
sort(q+1,q+1+n);
long long res=0,t=0;
F=1;
for(int i=1;i<=n;++i)
{
res+=q[i].t-t,t=q[i].t;
res-=q[i].s;
if(res<0)
{
F=0;
break;
}
}
if(F)
cout<<"Yes\n";
else
cout<<"No\n";
}
int c,T;
int main()
{
freopen("move.in","r",stdin);
freopen("move.out","w",stdout);
ios::sync_with_stdio(0),cin.tie(0);
cin>>c>>T;
while(T--)
solve();
return 0;
}