#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<queue>
#include<iostream>
#include<assert.h>
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define per(i,a,b) for(int i=a;i>=b;i--)
#define rpe(i,x) for(int i=_he[x];i;i=_ne[i])
using namespace std;
typedef long long LL;
typedef pair<LL,int> pli;
const int N=2e5+10,M=5e5+10,inf=0x3f3f3f3f;
const LL INF=0x3f3f3f3f3f3f3f3f;
int n,a[N],b[N],L[N],R[N],pos[N];
LL t[N];
pli d[N];
bool cmp(pli x,pli y)
{
if(x.first==y.first)
{
int idx=x.second,idy=y.second;
if(a[idx]<=b[idx]&&a[idy]<=b[idy])
return (a[idx]<a[idy]);
else if(a[idx]>=b[idx]&&a[idy]>=b[idy])
return (a[idx]>a[idy]);
else
return (a[idx]<=b[idx])>(a[idy]<=b[idy]);
}
return (x.first>y.first);
}
void Work()
{
scanf("%d",&n);
rep(i,1,n)
scanf("%d%d%lld",&a[i],&b[i],&t[i]),
d[i]={t[i],i};
pos[n+1]=inf;
sort(d+1,d+1+n,cmp);
LL now=INF;
rep(i,1,n)L[i]=R[i]=i,pos[i]=b[i];
rep(i,1,n)
{
int id=d[i].second;
now=min(now,d[i].first);
int l=L[id],r=R[id];
if(a[id]<b[id])
{
int pre=pos[l-1];
while(l<=r)
{
if(a[r]<pre)break;
now-=(pos[r]-a[r]);
if(l<r)pos[r-1]=pos[r]-1;
pos[r]=a[r];
r--;
if(l<=r)L[l]=L[r]=l,R[l]=R[r]=r;
}
if(l<=r)
{
now-=(LL)((LL)pos[l]-pre-1)*(r-l+1);
int l0=L[l-1],r0=l-1;
pos[l]=pos[r0]+1,pos[r]=pos[l]+r-l;
R[l0]=r,L[r]=l0;
}
}
else
{
int nxt=pos[r+1];
while(l<=r)
{
if(a[l]>nxt)break;
now-=(a[l]-pos[l]);
if(l<r)pos[l+1]=pos[l]+1;
pos[l]=a[l];
l++;
if(l<=r)L[l]=L[r]=l,R[l]=R[r]=r;
}
if(l<=r)
{
now-=(LL)((LL)nxt-pos[r]-1)*(r-l+1);
int l2=r+1,r2=R[r+1];
pos[r]=pos[l2]-1,pos[l]=pos[r]-(r-l);
R[l]=r2,L[r2]=l;
}
}
if(now<0){
puts("No");
return;
}
}
puts("Yes");
}
int main()
{
freopen("move.in","r",stdin);
freopen("move.out","w",stdout);
int TP,TOT;
scanf("%d%d",&TP,&TOT);
while(TOT--)Work();
return 0;
}