#include<bits/stdc++.h>
using namespace std;
const int INF = 1 << 30;
bool check()
{
  int M, N;
  int low[101][101] = {{}}, hig[101][101];
  bool graph[101][101] = {{}};
  fill_n(*hig, 101 * 101, INF);
  
  cin >> M >> N;
  for(int i = 0; i < M; i++) {
    int K;
    cin >> K;
    while(K--) {
      int s, t;
      string cond;
      cin >> s >> cond >> t;
      --s;
      if(cond == ">=") low[i][s] = max(low[i][s], t);
      else             hig[i][s] = min(hig[i][s], t);
      if(low[i][s] > hig[i][s]) return(false);
    }
  }
  for(int i = 0; i < M; i++) {
    for(int j = 0; j < M; j++) {
      if(i == j) continue;
      for(int k = 0; k < N; k++) graph[i][j] |= low[i][k] > hig[j][k];
    }
  }
  for(int k = 0; k < M; k++) {
    for(int i = 0; i < M; i++) {
      for(int j = 0; j < M; j++) {
        graph[i][j] |= graph[i][k] & graph[k][j];
      }
      if(graph[i][i]) return(false);
    }
  }
  return(true);              
}

int main()
{
  cout << (check() ? "Yes" : "No") << endl;
}