import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.StringTokenizer;
public class Main {
FastScanner in;
class Skill {
super();
this.min = min;
this.max = max;
}
public Skill() {
super();
this.max = minusOne;
}
}
class SpecialSkill {
Skill[] skills;
public SpecialSkill(int n) {
super();
skills = new Skill[n];
for (int i = 0; i < n; i++) {
skills[i] = null;
}
}
public int compareSkills(SpecialSkill o) {
boolean thisGreaterO = false;
boolean thisLessO = false;
for (int i = 0; i < this.skills.length; i++) {
if (this.skills[i] == null || o.skills[i] == null) {
continue;
}
if (this.skills[i].max.compareTo(o.skills[i].min) < 0) {
if (this.skills[i].max.equals(minusOne) == false
&& o.skills[i].min.equals(minusOne) == false) {
thisLessO = true;
}
}
if (this.skills[i].min.compareTo(o.skills[i].max) > 0) {
if (this.skills[i].min.equals(minusOne) == false
&& o.skills[i].max.equals(minusOne) == false) {
thisGreaterO = true;
}
}
}
if (thisGreaterO && thisLessO) {
return 1000;
}
if (thisGreaterO) {
return 1;
} if (thisLessO) {
return -1;
}
return 0;
}
public boolean checkSkill() {
for (int i = 0; i < skills.length; i++) {
if (skills[i] == null) {
continue;
}
if (skills[i].max.compareTo(skills[i].min) < 0) {
if (this.skills[i].max.equals(minusOne) == false
&& this.skills[i].min.equals(minusOne) == false) {
return false;
}
}
}
return true;
}
}
ArrayList<Integer>[] graph;
int[] was;
boolean dfs(int cur, int prev) {
was[cur] = 1;
for(int i : graph[cur]) {
if (was[i] == 1) {
if (i != prev) {
return false;
}
} else if (was[i] == 0){
if (!dfs(i, cur)) {
return false;
}
}
}
was[cur] = 2;
return true;
}
int m = in.nextInt();
int n = in.nextInt();
for (int i = 0; i < m; i++) {
graph[i] = new ArrayList<>();
}
was = new int[m];
SpecialSkill[] specialSkills = new SpecialSkill[m];
for (int i = 0; i < m; i++) {
specialSkills[i] = new SpecialSkill(n);
}
for (int i = 0; i < m; i++) {
int k = in.nextInt();
for (int j = 0; j < k; j++) {
int a = in.nextInt() - 1;
if (cond.equals(">=") == true) {
if (specialSkills[i].skills[a] == null) {
specialSkills[i].skills[a] = new Skill();
}
if (specialSkills[i].skills[a].min.equals(minusOne)) {
specialSkills[i].skills[a].min = b;
continue;
}
specialSkills[i].skills[a].min = specialSkills[i].skills[a].min
.max(b);
} else {
// if (b.compareTo(BigInteger.ZERO) < 0) {
// out.println("NO");
// return;
// }
if (specialSkills[i].skills[a] == null) {
specialSkills[i].skills[a] = new Skill();
}
if (specialSkills[i].skills[a].max.equals(minusOne)) {
specialSkills[i].skills[a].max = b;
continue;
}
specialSkills[i].skills[a].max = specialSkills[i].skills[a].max
.min(b);
}
}
if (!specialSkills[i].checkSkill()) {
out.println("NO");
return;
}
}
for (int i = 0; i < m; i++) {
for (int j = i + 1; j < m; j++) {
int temp = specialSkills[i].compareSkills(specialSkills[j]);
if (temp == 1000) {
out.println("NO");
return;
} else if (temp == -1) {
graph[j].add(i);
} else if (temp == 1) {
graph[i].add(j);
}
}
}
for (int i = 0; i < m; i++) {
if (was[i] == 0) {
if(!dfs(i, -1)) {
out.println("NO");
return;
}
}
}
out.println("YES");
}
public void run() {
try {
in = new FastScanner(inputStream);
solve();
out.close();
e.printStackTrace();
}
}
private class FastScanner {
}
public boolean hasNext() {
while (st == null || !st.hasMoreTokens()) {
try {
if (line == null) {
return false;
}
e.printStackTrace();
}
}
if (st != null && st.hasMoreTokens()) {
return true;
}
return false;
}
if (hasNext()) {
return st.nextToken();
}
return null;
}
public int nextInt() {
}
public long nextLong() {
return Long.
parseLong(next
()); }
public double nextDouble() {
return Double.
parseDouble(next
()); }
}
public static void main
(String[] args
) { new Main().run();
}
}