Since the giant heads have appeared in the sky all humanity is in danger, so all Ricks and Mortys from all parallel universes are gathering in groups to find a solution to get rid of them. 

There are n parallel universes participating in this event (n Ricks and n Mortys). I. e. each of n universes has one Rick and one Morty. They're gathering in m groups. Each person can be in many groups and a group can contain an arbitrary number of members.

Ricks and Mortys have registered online in these groups. So, a person can have joined a group more than once (developer of this website hadn't considered this possibility).

<image>

Summer from universe #1 knows that in each parallel universe (including hers) exactly one of Rick and Morty from that universe is a traitor and is loyal, but no one knows which one. She knows that we are doomed if there's a group such that every member in that group is a traitor (they will plan and destroy the world). 

Summer knows that if there's a possibility that world ends (there's a group where all members are traitors) she should immediately cancel this event. So she wants to know if she should cancel the event. You have to tell her yes if and only if there's at least one scenario (among all 2n possible scenarios, 2 possible scenarios for who a traitor in each universe) such that in that scenario the world will end.

Input

The first line of input contains two integers n and m (1 ≤ n, m ≤ 104) — number of universes and number of groups respectively.

The next m lines contain the information about the groups. i-th of them first contains an integer k (number of times someone joined i-th group, k > 0) followed by k integers vi, 1, vi, 2, ..., vi, k. If vi, j is negative, it means that Rick from universe number  - vi, j has joined this group and otherwise it means that Morty from universe number vi, j has joined it.

Sum of k for all groups does not exceed 104.

Output

In a single line print the answer to Summer's question. Print "YES" if she should cancel the event and "NO" otherwise.

Examples

Input

4 2
1 -3
4 -2 3 2 -3


Output

YES


Input

5 2
5 3 -2 1 -1 5
3 -5 2 5


Output

NO


Input

7 2
3 -1 6 7
7 -5 4 2 4 7 -3 4


Output

YES

Note

In the first sample testcase, 1st group only contains the Rick from universe number 3, so in case he's a traitor, then all members of this group are traitors and so Summer should cancel the event.
import java.io.DataInputStream;
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.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.InputMismatchException;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.Random;
import java.util.Scanner;
import java.util.Stack;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;

public class main {
	private static InputStream stream;
	private static byte[] buf = new byte[1024];
	private static int curChar;
	private static int numChars;
	private static SpaceCharFilter filter;
	private static PrintWriter pw;
	private static long max = Long.MIN_VALUE;
	private static int mod = 1000000000 + 7;
	private static boolean flag=false;
	private static int count=0;
	private static void soln() {
		int n=nextInt();
		int m=nextInt();
		boolean flag=true;
		while(m-->0){
			int k=nextInt();
			boolean flag1=false;
			HashSet<Integer> s=new HashSet<>();
			for(int i=0;i<k;i++){
				int x=nextInt();
				s.add(x);
				if(s.contains(-1*x)){
					flag1=true;
				}
			}
			if(!flag1)
				flag=false;
		}
		if(flag)
			pw.println("NO");
		else
			pw.println("YES");
	}
	public static class Segment {
		private int[] tree;
		private int size;
		private int n;
		private class node{
			private int a;
			private int b;
			private int c;
			public node(int x,int y,int z){
				a=x;
				b=y;
				c=z;
			}
		}
		public Segment(int n){
			//this.base=arr;
			int x = (int) (Math.ceil(Math.log(n) / Math.log(2)));
	        size = 2 * (int) Math.pow(2, x) - 1;
			tree=new int[size];
			this.n=n;
			build(0,0,n-1);
		}
		private void build(int id,int l,int r){
			//pw.println(1);
			if(r==l){
				tree[id]=0;
				return;
			}
			int mid=l+(r-l)/2;
			//System.out.println(2*id+1+" "+l+" "+mid);
			build(2*id+1,l,mid);
			//System.out.println(2*id+2+" "+(mid+1)+" "+r);
			build(2*id+2,mid+1,r);
			//tree[id]=tree[2*id+1]+tree[2*id+2];
		}
		public int query(int l,int r){
			return queryUtil(l,r,0,0,n-1);
		}
		private int queryUtil(int x,int y,int id,int l,int r){
			if(l>y || x>r) 
				return 0;
			if(x <= l && r<=y)
				return tree[id];
			int mid=l+(r-l)/2;
			return Math.max(queryUtil(x,y,2*id+1,l,mid),queryUtil(x,y,2*id+2,mid+1,r));
		}
		/*private void cnt(int id,int l,int r,HashSet<Integer> set){
			if(tree[id]!=0){
				set.add(tree[id]);
				return;
			}
			if(r==l)
				return;
			int mid=l+(r-l)/2;
			cnt(2*id+1,l,mid,set);
			cnt(2*id+2,mid+1,r,set);
		}*/
		public void update(int i,int colour,int id,int l,int r){
			if(i<l || i>r)
				return;
			if(l==r){
				tree[id]=colour;
				return;
			}
			int mid=l+(r-l)/2;
			//shift(id);
			update(i,colour,2*id+1,l,mid);
			update(i,colour,2*id+2,mid+1,r);
			tree[id]=Math.max(tree[2*id+1],tree[2*id+2]);
		}
		private void shift(int id){
			if(tree[id]!=0){
				tree[2*id+1]=tree[2*id+2]=tree[id];
			}
			tree[id]=0;
		}
	}

	private static class DSU{
		int[] parent;
		int[] cnt;
		public DSU(int n){
			parent=new int[n];
			cnt=new int[n];
			for(int i=0;i<n;i++){
				parent[i]=i;
			}
		}
		int find(int i){
	        while(parent[i] !=i){
	        	parent[i]=parent[parent[i]];
	        	i=parent[i];
	        }
	        return i;
	    }
		void Union(int x, int y){
	        int xset = find(x);
	        int yset = find(y);
	        parent[xset] = yset;
	        cnt[yset]+=cnt[xset];
	        cnt[xset]=0;
	    }
	}
	private static class Edge implements Comparable<Edge>{
		int x;
		int y;
		int w;
		public Edge(int a,int b,int c){
			x=a; y=b; w=c;
		}
		@Override
		public int compareTo(Edge o) {
			return o.w-this.w;
		}
	}
	/*static class Suffix implements Comparable<Suffix>{
		int index;
		int[] rank=new int[2];
		@Override
		public int compareTo(Suffix arg0){
			return (this.rank[0]==arg0.rank[0])?(this.rank[1]<arg0.rank[1]?-1:1):(this.rank[0]<arg0.rank[0]?-1:1);
		}	
	}
	private static int[] buildSuffix(String s,int n){
		Suffix[] arr=new Suffix[n];
		for(int i=0;i<n;i++)
			arr[i]=new Suffix();
		for(int i=0;i<n;i++){
			arr[i].index=i;
			arr[i].rank[0]=s.charAt(i)-'a';
			arr[i].rank[1]=((i+1)<n)?(s.charAt(i+1)-'a'):-1;
		}
		Arrays.sort(arr);
		//for(int i=0;i<n;i++)
			//System.out.print(arr[i].index);
		int[] ind=new int[n];
		for(int k=4;k<2*n;k=k*2){
			int rank=0;
			int p_rank=arr[0].rank[0];
			arr[0].rank[0]=rank;
			ind[arr[0].index]=0;
			for(int i=1;i<n;i++){
				if (arr[i].rank[0] == p_rank && arr[i].rank[1] == arr[i-1].rank[1]) {
	                p_rank = arr[i].rank[0];
	                arr[i].rank[0] = rank;
	            }
	            else{
	                p_rank = arr[i].rank[0];
	                arr[i].rank[0] = ++rank;
	            }
	            ind[arr[i].index] = i;
	        }
			for(int i=0;i<n;i++){
				int n_index=arr[i].index + k/2;
				arr[i].rank[1]=(n_index<n)?arr[ind[n_index]].rank[0] : -1;
			}
			Arrays.sort(arr);
		}
		int[] suffixArr=new int[n];
		for(int i=0;i<n;i++)
			suffixArr[i]=arr[i].index;
		return suffixArr;
	}*/
	private static long pow(long a, long b, long c) {
		if (b == 0)
			return 1;
		long p = pow(a, b / 2, c);
		p = (p * p) % c;
		return (b % 2 == 0) ? p : (a * p) % c;
	}
	
	private static class Pair implements Comparable<Pair> {
		int x;
		int y;
		int z;
		public Pair(int a,int b,int c) {
			x=a;y=b;z=c;
		}
		@Override
		public int compareTo(Pair arg0) {
			return (this.x!=arg0.x)?(this.x-arg0.x):((this.y!=arg0.y)?(this.y-arg0.y):(this.z-arg0.z));
		}
	}

	private static int gcd(int a1, int a2) {
		if (a2 == 0)
			return a1;
		return gcd(a2, a1 % a2);
	}

	private static long max(long a, long b) {
		if (a > b)
			return a;
		return b;
	}

	private static long min(long a, long b) {
		if (a < b)
			return a;
		return b;
	}

	public static void main(String[] args) throws Exception {
		new Thread(null,new Runnable(){
			@Override
			public void run() {
				InputReader(System.in);
				pw = new PrintWriter(System.out);
				soln();
				pw.close();
			}
		},"1",1<<26).start();
	}

	public static void InputReader(InputStream stream1) {
		stream = stream1;
	}

	private static boolean isWhitespace(int c) {
		return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
	}

	private static boolean isEndOfLine(int c) {
		return c == '\n' || c == '\r' || c == -1;
	}

	private static int read() {
		if (numChars == -1)
			throw new InputMismatchException();
		if (curChar >= numChars) {
			curChar = 0;
			try {
				numChars = stream.read(buf);
			} catch (IOException e) {
				throw new InputMismatchException();
			}
			if (numChars <= 0)
				return -1;
		}
		return buf[curChar++];
	}

	private static int nextInt() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		int res = 0;
		do {
			if (c < '0' || c > '9')
				throw new InputMismatchException();
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	}

	private static long nextLong() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		long res = 0;
		do {
			if (c < '0' || c > '9')
				throw new InputMismatchException();
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	}

	private static String nextToken() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		StringBuilder res = new StringBuilder();
		do {
			res.appendCodePoint(c);
			c = read();
		} while (!isSpaceChar(c));
		return res.toString();
	}

	private static String nextLine() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		StringBuilder res = new StringBuilder();
		do {
			res.appendCodePoint(c);
			c = read();
		} while (!isEndOfLine(c));
		return res.toString();
	}

	private static int[] nextIntArray(int n) {
		int[] arr = new int[n];
		for (int i = 0; i < n; i++) {
			arr[i] = nextInt();
		}
		return arr;
	}

	private static long[] nextLongArray(int n) {
		long[] arr = new long[n];
		for (int i = 0; i < n; i++) {
			arr[i] = nextLong();
		}
		return arr;
	}

	private static void pArray(int[] arr) {
		for (int i = 0; i < arr.length; i++) {
			System.out.print(arr[i] + " ");
		}
		System.out.println();
		return;
	}

	private static void pArray(long[] arr) {
		for (int i = 0; i < arr.length; i++) {
			System.out.print(arr[i] + " ");
		}
		System.out.println();
		return;
	}

	private static boolean isSpaceChar(int c) {
		if (filter != null)
			return filter.isSpaceChar(c);
		return isWhitespace(c);
	}

	private interface SpaceCharFilter {
		public boolean isSpaceChar(int ch);
	}
}