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.util.Scanner;
import java.io.*;
import java.util.*;
import java.math.*;
import static java.lang.Math.*;



public class Main
{	

	static BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
    static long mod=(long)1e9+7;
    static int i,j,k;
//////////////////////////////////////    CODE STARTS   ///////////////////////////////////////////////    
	static int count=0;
	
	public void solve() throws IOException{
	    int n =i(),m=i();
	    boolean flag = true;
	    for(i=0;i<m;i++)
	    {
	        int q = i();
	        flag=true;
	        int[] ar = new int[q];
	        int[] br = new int[q];
	        for(j=0;j<q;j++)
	        {
	            ar[j] = i();
	            br[j] = ar[j];
	        }
	        Arrays.sort(br);
	        
	        for(j=0;j<q;j++)
	        {
	            int x = ar[j];
	            int y = Arrays.binarySearch(br,-x);
	            if(y>=0)
	            {
	                flag= false;
	               
	                break;
	            }
	            
	        }
	        if(flag)
	        {
	            count=1;
	        }
	        
	        
	    }
	    if(count==1)
	    {
	        out.pl("YES");
	    }
	    else
	    {
	        out.pl("NO");
	    }
	}
    static int gcd(int a,int b)
    {
        return b==0?a:gcd(b,a%b);
    }
 
 
 ////////////////////////////////////     CODE ENDS      //////////////////////////////////////////////

 
	static InputReader sc;
	static OutputWriter out;
	Main() throws IOException {
	    sc = new InputReader(System.in);
	    out = new OutputWriter(System.out);
		solve();
		out.close();
	}
 
	public static void main(String args[]) {
		new Thread(null, new Runnable() {
			public void run() {
				try {
					new Main();
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		}, "1", 1 << 26).start();
	}
   
    
    
    
    
    /////////////////////////////////////////////////////////////////////////////////////
	

public static int floor(int[] a,int x){
				int low = 0;
        		int end = a.length ;
        
       
        		while (low < end) {
        		  int mid = (low + end) >> 1;
				  if(x==a[mid])
						return mid;
            	  if (x <a[mid]) 
			
                	end = mid;
        		  
        		  else 
                		low = mid+1;
				}
				return low-1;
				

}
static int Ceil(int[] A,int l,int r,int key)
{       while(r-l>1)
        {
            int m=l+(r-l)/2;
            if(A[m]>=key)   r=m;
            else            l=m;
        }
        return r;
}
  
  


	static int visit[];
	static Stack<Integer> temp1;
	static Stack<Long> temp2;
	static class InputReader{
		private InputStream stream;
		private byte[] buf = new byte[1024];
		private int curChar;
		private int numChars;
		private SpaceCharFilter filter;
		
		public InputReader(InputStream stream)
		{
			this.stream = stream;
		}
		
		public 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++];
		}
	 
		public String nextLine()
		{
			BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
			String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
		}
		public 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;
		}
		
		public 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;
		}
		
		public double nextDouble() 
		{
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') 
			{
				sgn = -1;
				c = read();
			}
			double res = 0;
			while (!isSpaceChar(c) && c != '.') 
			{
				if (c == 'e' || c == 'E')
					return res * Math.pow(10, nextInt());
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			}
			if (c == '.') 
			{
				c = read();
				double m = 1;
				while (!isSpaceChar(c)) 
				{
					if (c == 'e' || c == 'E')
						return res * Math.pow(10, nextInt());
					if (c < '0' || c > '9')
						throw new InputMismatchException();
					m /= 10;
					res += (c - '0') * m;
					c = read();
				}
			}
			return res * sgn;
		}
		
		public String readString() 
		{
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do 
			{
				res.appendCodePoint(c);
				c = read();
			} 
			while (!isSpaceChar(c));
			
			return res.toString();
		}
	 
		public boolean isSpaceChar(int c) 
		{
			if (filter != null)
				return filter.isSpaceChar(c);
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}
	 
		public String next() 
		{
			return readString();
		}
		
		public interface SpaceCharFilter 
		{
			public boolean isSpaceChar(int ch);
		}
		
 
		
 
	
	}
	static class OutputWriter {
		private final PrintWriter writer;
 
		public OutputWriter(OutputStream outputStream) {
			writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
		}
 
		public OutputWriter(Writer writer) {
			this.writer = new PrintWriter(writer);
		}
 
		public void p(Object...objects) {
			for (int i = 0; i < objects.length; i++) {
				if (i != 0)
					writer.print(' ');
				writer.print(objects[i]);
			}
		}
 
		public void pl(Object...objects) {
			p(objects);
			writer.println();
		}
 
		public void close() {
			writer.close();
		}
 
		public void flush() {
			writer.flush();
		}
 
	}
     
    ////////////////////////////////////////////////////////////////////
 
	static int i() {
		return sc.nextInt();
	}
 
	static long l() {
		return sc.nextLong();
	}
 
	static double d() {
		return sc.nextDouble();
	}
 
	static String s() {
		return sc.readString();
	}
 
	static int[] iarr(int size) {
		int[] array = new int[size];
		for (int i = 0; i < size; i++) {
			array[i] = i();
		}
		return array;
	}
 
	static long[] larr(int size) {
		long[] array = new long[size];
		for (int i = 0; i < size; i++) {
			array[i] = l();
		}
		return array;
	}
 
	static double[] darr(int size) {
		double[] array = new double[size];
		for (int i = 0; i < size; i++) {
			array[i] = d();
		}
		return array;
	}
 
	static String[] sarr(int size) {
		String[] array = new String[size];
		for (int i = 0; i < size; i++) {
			array[i] = s();
		}
		return array;
	}
 
	static char[] stoc(String ss) {
		return ss.toCharArray();
	}
  

}