// g++ -std=c++11 a.cpp
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>	
#include<map>
#include<set>
#include<unordered_map>
#include<utility>
#include<cmath>
#include<random>
#include<cstring>
#include<queue>
#include<stack>
#include<bitset>
#include<cstdio>
#include<sstream>
#include<iomanip>
#include<assert.h>
#include<typeinfo>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define FOR(i,a) for(auto i:a)
#define pb push_back
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
#define show1d(v) rep(i,v.size())cout<<" "<<v[i];cout<<endl<<endl;
#define show2d(v) rep(i,v.size()){rep(j,v[i].size())cout<<" "<<v[i][j];cout<<endl;}cout<<endl;
using namespace std;
//kaewasuretyuui
typedef long long ll;
//#define int ll
typedef int Def;
typedef pair<Def,Def> pii;
typedef vector<Def> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<Def,pii> pip;
typedef vector<pip>vip;
// #define mt make_tuple
// typedef tuple<int,int,int> tp;
// typedef vector<tp> vt;
template<typename A,typename B>bool cmin(A &a,const B &b){return a>b?(a=b,true):false;}
template<typename A,typename B>bool cmax(A &a,const B &b){return a<b?(a=b,true):false;}
//template<class C>constexpr int size(const C &c){return (int)c.size();}
//template<class T,size_t N> constexpr int size(const T (&xs)[N])noexcept{return (int)N;}
const double PI=acos(-1);
const double EPS=1e-9;
Def inf = sizeof(Def) == sizeof(long long) ? 2e18 : 1e9+10;
int dx[]={0,1,0,-1,1,1,-1,-1};
int dy[]={1,0,-1,0,1,-1,1,-1};//RDLU
class TOPO{//out is tsort's return.
	public:
	vvi G;
	vi out;
	vector<bool>V;
	vi indeg;
	int n;
	TOPO(int size){
		n=size;
		G=vvi(n);
		out=vi(0);
		V=vector<bool>(n);
		indeg=vi(n);
	}
	void add_edge(int s,int t){
		G[s].pb(t);
	}
	void bfs(int s){
		queue<int>q;
		q.push(s);
		V[s]=true;
		while(!q.empty()){
			int u=q.front();q.pop();
			out.pb(u);
			rep(i,G[u].size()){
				int v=G[u][i];
				indeg[v]--;
				if(indeg[v]==0&&!V[v]){
					V[v]=true;
					q.push(v);
				}
			}
		}
	}
	void tsort(){
		rep(i,n)indeg[i]=0;
		rep(i,n)rep(j,G[i].size()){
			int v=G[i][j];
			indeg[v]++;
		}
		rep(i,n)if(indeg[i]==0&&!V[i])bfs(i);
//		rep(i,n)cout<<out[i]<<endl;
	}
};

int main(){
	int n,m;
	cin>>n>>m;
	int in[110][110][2];
	rep(i,110)rep(j,110){
		in[i][j][0]=inf;
		in[i][j][1]=-inf;
	}
	bool h=true;
	rep(i,n){
		int q;
		cin>>q;
		rep(j,q){
			int a,b;
			string s;
			cin>>a>>s>>b;
			if(s=="<=")cmin(in[i][a-1][0],b);
			if(s==">=")cmax(in[i][a-1][1],b);
		}
		rep(j,m)if(in[i][j][0]<in[i][j][1])h=false;
	}
	if(!h){
		cout<<"No"<<endl;
		return 0;
	}
	TOPO tp(n);
	rep(i,n)loop(j,i+1,n){
		int to=-1;
		rep(k,m){
			if(in[i][k][0]!=inf&&in[j][k][1]!=-inf&&in[i][k][0]<in[j][k][1]){
				if(to==1)h=false;
				to=0;
			}
			if(in[i][k][1]!=-inf&&in[j][k][0]!=inf&&in[j][k][0]<in[i][k][1]){
				if(to==0)h=false;
				to=1;
			}
		}
		if(to==0)tp.add_edge(i,j);
		if(to==1)tp.add_edge(j,i);
	}
	if(!h){
		cout<<"No"<<endl;
		return 0;
	}
	
	tp.tsort();
	if(tp.out.size()==n)cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
}

/*
vi fact(10);
double f(double p){
	return (double)fact[8]/(fact[p]*fact[8-p])*pow(0.25,p)*pow(0.75,8-p);
}
vs in;
string F(string a){
	vvi d(4,vi(4));
	rep(i,4)d[i][3]=i;
	rep(i,5)rep(j,in[0].size())if(in[i][j]=='-'){
		int id[2]={i-1,(j-7)/5};
		int sc[2]={in[i][j-1]-'0',in[i][j+1]-'0'};
		if(sc[0]>sc[1])d[id[0]][0]-=3,d[id[1]][0]+=3;
		if(sc[0]<sc[1])d[id[0]][0]+=3,d[id[1]][0]-=3;
		if(sc[0]==sc[1])d[id[0]][0]-=1,d[id[1]][0]-=1;
		
		d[id[0]][1]-=sc[0]-sc[1];
		d[id[1]][1]-=sc[1]-sc[0];
		
		d[id[0]][2]-=sc[0];
		d[id[1]][2]-=sc[1];
	}
	sort(all(d));
//	show2d(d);
	vvi nd;
	rep(i,4)if(a[d[i][3]]=='1')nd.pb(d[i]);
	nd.pb({-inf,-inf,-inf,-1});
	string out="";
	rep(i,nd.size()){
		loop(j,i+1,nd.size())if(nd[i][0]!=nd[j][0]||nd[i][1]!=nd[j][1]||nd[i][2]!=nd[j][2]){
			if(j-i==1)out+=(char)('1'+nd[i][3]);
			else if(j-i==nd.size()-1)out+=string('9',j-i);
			else{
				string tmp="0000";
				loop(k,i,j)tmp[nd[k][3]]++;
				out+=F(tmp);
				i=j-1;
			}
			break;
		}
	}
	return out;
}
int main(){
	fact[0]=fact[1]=1;
	loop(i,2,10)fact[i]=fact[i-1]*i;
	
	int q;
	cin>>q;
	while(q--){
		in=vs(5);
		rep(i,5)cin>>in[i];
		int t=0;
		int pos[2][2];
		rep(i,in.size())rep(j,in[0].size()-1)if(in[i][j]=='-'&&in[i][j+1]=='_'){
			pos[t][0]=i;
			pos[t][1]=j;
			t++;
		}
		char c=-1;
		rep(i,5)if(in[i][0]=='*')c='0'+i;
		double out=0;
		rep(i,9)rep(j,9)rep(k,9)rep(l,9){
			in[pos[0][0]][pos[0][1]-1]='0'+i;
			in[pos[0][0]][pos[0][1]+1]='0'+j;
			in[pos[1][0]][pos[1][1]-1]='0'+k;
			in[pos[1][0]][pos[1][1]+1]='0'+l;
			
			double now=f(i)*f(j)*f(k)*f(l);
			string w=F("1111");
//			cout<<w<<endl;
			int co1=0,co2=0;
			rep(e,4)if(w[e]=='9')co2++;
			rep(e,2)if(w[e]=='9')co1++;
			int to=5;
			rep(_,4)if(w[_]==c)to=_;
			if(to<2)out+=now;
			if(to==5&&(w[0]=='9'||w[1]=='9'))
				out+=now*co1/co2;
		}
		cout<<shosu(10)<<out<<endl;
	}
	
}
*/






