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

a=[0]*n

for i in range(m):

	u,v=list(map(int,input().split()))

	a[u-1]^=1

	a[v-1]^=1

if sum(a):

	print("NO")

else:

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

t=0

for i in range(m):

	u,v=list(map(int,input().split()))

	t^=u^v

print(("NO" if t else "YES"))
n, m = list(map(int, input().split()))
a = [0] * n
for i in range(m):
    u, v = list(map(int, input().split()))
    a[u - 1] ^= 1
    a[v - 1] ^= 1
if sum(a):
    print("NO")
else:
    print("YES")

n, m = list(map(int, input().split()))
t = 0
for i in range(m):
    u, v = list(map(int, input().split()))
    t ^= u ^ v
print(("NO" if t else "YES"))

-a = [0] * n +t = 0 -    a[u - 1] ^= 1 -    a[v - 1] ^= 1 -if sum(a): -    print("NO") -else: -    print("YES") +    t ^= u ^ v +print(("NO" if t else "YES"))