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 2^{n} 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 ≤ 10^4) — 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 v_{i}, 1, v_{i}, 2, ..., v_{i}, k. If v_{i}, j is negative, it means that Rick from universe number  - v_{i}, j has joined this group and otherwise it means that Morty from universe number v_{i}, j has joined it.

Sum of k for all groups does not exceed 10^4.


-----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.

Difficulty: interview

Starter code:

Solutions:
n, m = map(int,input().split())
for i in range(m):
    a, *b = map(int,input().split())
    b = set(b)
    for j in b:
        if -j in b:
            break
    else:
        print("YES")
        break
else:
    print("NO")

n, m = map(int, input().split())
ans = "NO"
for i in range(m):
    v = set(list(map(int, input().split()))[1:])
    ans = "YES"
    for vi in v:
        if -vi in v:
            ans = "NO"
            break
    if ans == "YES":
        break
print(ans)

n, m = map(int, input().split())
flag1 = 0
for i in range(m):
	a = list(map(int, input().split()))
	a = set(a[1:])
	flag = 0
	for x in a:
		if -x in a:
			flag = 1
			break
	if not flag:
		flag1 = 1
		break
print('YES' if flag1 else 'NO')

import sys

n, m = list(map(int, input().split()))

for _ in range(m):
    l = [int(x) for x in input().split()][1:]
    s = set(l)
    ok = False
    for i in l:
        if -i in s:
            ok = True
            break
    if not ok:
        print("YES")
        return

print("NO")
       


from sys import stdin, stdout

doomed=False
n, m = list(map(int, stdin.readline().rstrip().split()))

for _ in range(m):
    groupInfo = [int(a) for a in stdin.readline().rstrip().split()]
    groupSet=set()
    doomGroup=True
    for i in groupInfo[1:]:
        if -i in groupSet:
            doomGroup=False
            break
        else:
            groupSet.add(i)
    if doomGroup:
        doomed=True

if doomed:
    print("YES")
else:
    print("NO")


n, m = list(map(int, input().split()))
for i in range(m):
    good = 0
    morty = set()
    rick = set()
    now = list(map(int, input().split()))[1:]
    for c in now:
        if c < 0:
            morty.add(abs(c))
            if abs(c) in rick:
                good = 1
        if c > 0:
            rick.add(abs(c))
            if abs(c) in morty:
                good = 1
    if not good:
        print("YES")
        return
print("NO")


n, m = list(map(int, input().split()))

bad = 0
for _ in range(m):
    v = [0]*(n+1)
    ok = 0
    for u in [int(i) for i in input().split()[1:]]:
        au = abs(u)
        su = 1 if u < 0 else 2
        v[au] |= su
        if v[au] == 3: ok = 1
    if not ok: bad = 1

print("YES" if bad else "NO")


n,m=list(map(int,input().split()))
flag = 0
for i in range(m):
    s=0
    q = set()
    a = list(map(int,input().split()))
    for item in a[1:]:
        if(-item in q):
            s=1
        q.add(item)
    if(s==0):
        flag=1
if(flag):
    print("YES")
else:
    print("NO")
        


n, m = map(int, input().split())

ans = 'NO'
for i in range(m):
    a = list(map(int, input().split()))[1: ]
    s = set()
    new_ans = False
    for j in range(len(a)):
        s.add(a[j])
        if -a[j] in s:
            new_ans = True
            break
    
    if not new_ans:
        ans = 'YES'
        break

print(ans)

import sys

def isDoomed(l):
    s = set(l)
    for e in s:
        if -e in s:
            return False
    return True

n, m = map(int, input().split())
for mm in range(m):
    l = list(map(int, input().split()))[1:]
    if isDoomed(l):
        print('YES')
        return
print('NO')

def main():
    n,m = list(map(int,input().split()))

    for i in range(0,m):
        mk = True
        mp = set()
        ar = [int(i) for i in input().split()[1:]]
        #print(ar)
        for i in ar:
            if (-i) in mp:
                mk = False
                break
            mp.add(i)
        if mk:
            print("YES")
            return;
    print("NO")

def __starting_point():
    main()

__starting_point()


n,m=map(int,input().split())
for _ in range(m):
    k,*l=map(int,input().split())
    l=set(l)
    for x in l:
        if -x in l: break
    else: print('YES'); break
else: print('NO')



n, m = list(map(int, input().split()))

dont_end = True

for _ in range(m):
    k, *elements = list(map(int, input().split()))
    some_set = set(elements)
    good = False
    for x in some_set:
        if (-x) in some_set:
            good = True
            break
    if not good:
        dont_end = False

if dont_end:
    print("NO")
else:
    print("YES")


n, m = list(map(int, input().split()))
ans = "NO"
for i in range(m):
    a = set()
    line = list(map(int, input().split()))
    answer = False
    for j in range(1, len(line)):
        if -line[j] in a:
            answer = True
            break
        a.add(line[j])
    if not answer:
        ans = "YES"
        break
print(ans)

import sys

n, m = list(map(int, input().split()))

a = []
for _ in range(m):
    a.append(set(map(int, input().split()[1:])))

for i in a:
    for j in i:
        if -j in i:
            break
    else:
        print("YES")
        return
print("NO")


n, m = map(int, input().split())
for i in range(m):
	l = list(map(int, input().split()))
	l = set(l[1:])
	for e in l:
		if (-e) in l:
			break
	else:
		print("YES")
		return
print("NO")

n, m = map(int, input().split())


def main():
    for i in range(m):
        g = list(map(int, input().split()))
        k = g[0]

        free = set()
        maybe = True
        for j in range(1, k + 1):
            if -g[j] in free:
                maybe = False
                break
            else:
                free.add(g[j])

        if (len(free) > 0) and maybe:
            return "YES"

    return "NO"

print(main())

n, m = [int(i) for i in input().split()]

def check(line):
	for i in line:
		if -i in line:
			return True
	return False
	
for _ in range(m):
	line = set([int(i) for i in input().split()][1:])
	if not check(line):
		print('YES')
		return

print('NO')


n,m = list(map(int, input().split()))
for i in range(m):
    a = list(map(int, input().split()))
    s = set()
    for i in range(1,len(a)):
        s.add(a[i])
    k = list(s)
    isok = 0
    for i in range(len(k)):
        if -k[i] in s:
            isok = 1
    if not isok:
        print("YES")
        return
print("NO")
            
        
    


""" Created by Henrikh Kantuni on 3/23/17 """

def __starting_point():
    n, m = list(map(int, input().split()))

    destroy = False
    while m > 0:
        group = [int(g) for g in input().split()][1:]

        if len(group) == 1:
            destroy = True
            break

        group = [abs(g) for g in list(set(group))]
        old_size = len(group)
        group = list(set(group))

        if len(group) == old_size:
            destroy = True
            break

        m -= 1

    if destroy:
        print("YES")
    else:
        print("NO")

__starting_point()

n,m = map(int,input().split())
f=1
while m>0:
	m-=1
	l = list(map(int,input().split()))
	n = l[0]
	l = l[1:]
	pos = set()
	neg = set()
	for i in l:
		if i<0:
			neg.add(i)
		else:
			pos.add(i)
	gflag = 0
	for i in pos:
		if(0-i in neg):
			gflag = 1
			break
	for i in neg:
		if(0-i in pos):
			gflag = 1
			break
	if(gflag==0):
		f = 0
		break
if(f==0):
	print('YES')
else:
	print('NO')

import sys

def solve():
    n, m = map(int, input().split())

    for i in range(m):
        k, *a = [int(j) for j in input().split()]
        a.sort(key=abs)
        # print(a)

        if k == 1:
            print('YES')
            return

        for j in range(len(a) - 1):
            if a[j] == -a[j + 1]:
                break
        else:
            print('YES')
            return

    print('NO')

def debug(x, table):
    for name, val in table.items():
        if x is val:
            print('DEBUG:{} -> {}'.format(name, val), file=sys.stderr)
            return None

def __starting_point():
    solve()
__starting_point()

n, m = list(map(int, input().split()))
for g in range(m):
    l = list(map(int, input().split()))
    s = set(l[1:])
    found = False
    for e in l[1:]:
        f = -e
        if f in s:
            found = True
            break
    if not found:
        print("YES")
        return
print("NO")


# -*- coding: utf-8 -*-
n, m = map(int, input().split(' '))
t = []
r = "NO"
for i in range(m):
    l = list(map(int, input().split(' ')))[1::]
    t.append(l)
for i in t:
    rik = []
    morti = []
    if r == "YES": break
    for j in i:
        if j<0 and j not in rik:
            j = abs(j)
            rik.append(j)
            if j in morti:
                r = "NO"
                break
            else:
                r = "YES"
        elif j>0 and j not in morti:
            morti.append(j)
            if j in rik:
                r = "NO"
                break
            else:
                r = "YES"
print(r)