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

cnt = [0]*(n+1)

for _ in range(m):

	a,b = list(map(int,input().split()))

	cnt[a] ^= 1

	cnt[b] ^= 1

for i in cnt:

	if i:

		print("NO")

		exit()

print("YES")
n,_,*l=list(map(int,open(0).read().split()))

c=[0]*-~n

for a,b in zip(l[::2],l[1::2]):

	c[a]^=1;c[b]^=1

print(("YNEOS"[any(i for i in c)::2]))
n, m = list(map(int, input().split()))
cnt = [0] * (n + 1)
for _ in range(m):
    a, b = list(map(int, input().split()))
    cnt[a] ^= 1
    cnt[b] ^= 1
for i in cnt:
    if i:
        print("NO")
        exit()
print("YES")

n, _, *l = list(map(int, open(0).read().split()))
c = [0] * -~n
for a, b in zip(l[::2], l[1::2]):
    c[a] ^= 1
    c[b] ^= 1
print(("YNEOS"[any(i for i in c) :: 2]))

-n, m = list(map(int, input().split())) -cnt = [0] * (n + 1) -for _ in range(m): -    a, b = list(map(int, input().split())) -    cnt[a] ^= 1 -    cnt[b] ^= 1 -for i in cnt: -    if i: -        print("NO") -        exit() -print("YES") +n, _, *l = list(map(int, open(0).read().split())) +c = [0] * -~n +for a, b in zip(l[::2], l[1::2]): +    c[a] ^= 1 +    c[b] ^= 1 +print(("YNEOS"[any(i for i in c) :: 2]))