#include <bits/stdc++.h>
template<typename T>
struct Edge {
    int from, to;
    T cost;
    Edge(int from, int to, T cost) {
        this->from = from;
        this->to = to;
        this->cost = cost;
    }
};
bool operator == (Edge<int> e1, Edge<int> e2) {
    return e1.from == e2.from &&
            e1.to == e2.to &&
            e1.cost == e2.cost;
}
template<typename T>
using Edges = std::vector<Edge<T>>;
template<typename T>
using Graph = std::vector<Edges<T>>;
template<typename T>
std::vector<int> topological_sort(const Graph<T> &graph) {
    Graph<T> g = graph;
    int n = g.size();
    std::vector<int> res;
    std::queue<int> que;
    std::vector<int> in(n);
    std::vector<bool> used(n, false);
    for(int i=0;i<n;++i) {
        for(int j=0;j<(int)(g[i].size());++j) {
            in[g[i][j].to]++;
        }
    }
    for(int i=0;i<n;++i) {
        if(in[i] == 0) que.push(i);
    }
    if((int)(que.size()) == 0) res.push_back(-1);
    while(!que.empty()) {
        int now = que.front(); que.pop();
        if(used[now]) {
            res.clear();
            res.push_back(-1);
            return res;
        }
        used[now] = true;
        res.push_back(now);
        for(int i=0;i<(int)(g[now].size());++i) {
            int next = g[now][i].to;
            if(in[next] == 1) {
                que.push(next);
        }
            in[next]--;
        }
    }
    return res;
}
using namespace std;
using ll = long long;
using P = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
const double eps = 1e-10;
const int MOD = 1000000007;
const int INF = 1000000000;
const ll LINF = 1ll<<50;
template<typename T>
void printv(const vector<T>& s) {
  for(int i=0;i<(int)(s.size());++i) {
    cout << s[i];
    if(i == (int)(s.size())-1) cout << endl;
    else cout << " ";
  }
}
int main() {
  cin.tie(0);
  cout << fixed << setprecision(10);
  int m, n; cin >> m >> n;
  vector<vector<P>> v(m, vector<P>(n, {-1, INF}));
  for(int i=0;i<m;++i) {
    int k; cin >> k;
    for(int j=0;j<k;++j) {
      int s, t; string cond; cin >> s >> cond >> t;
      s--;
      if(cond == "<=") {
        v[i][s] = {max(v[i][s].first, 0), min(v[i][s].second, t)};
      } else {
        v[i][s] = {max(v[i][s].first, t), min(v[i][s].second, 100)};
      }
    }
  }
  Graph<int> g(m);
  bool ok = true;
  for(int i=0;i<m;++i) {
    if(!ok) break;
    for(int j=0;j<n;++j) {
      if(v[i][j].first > v[i][j].second) {
        ok = false;
        break;
      }
    }
    if(!ok) break;
    for(int j=i+1;j<m;++j) {
      if(!ok) break;
      int val = 0;
      for(int k=0;k<n;++k) {
        if(v[i][k].first == -1 || v[j][k].first == -1) continue;
        if(v[i][k].first > v[j][k].second) {
          if(val == 0) {
            val = 1;
          } else if(val == -1) {
            ok = false;
            break;
          }
        } else if(v[j][k].first > v[i][k].second) {
          if(val == 0) {
            val = -1;
          } else if(val == 1) {
            ok = false;
            break;
          }
        }
      }
      if(val == 1) {
        g[j].push_back(Edge<int>(j, i, 1));
      } else if(val == -1) {
        g[i].push_back(Edge<int>(i, j, 1));
      }
    }
  }
  if(ok) {
    vector<int> tmp = topological_sort(g);
    if((int)(tmp.size()) < m || tmp[0] == -1) {
      cout << "No" << endl;
    } else {
      cout << "Yes" << endl;
    }
  } else {
    cout << "No" << endl;
  }
}



Measured memory_bytes: 3276