# @author Matheus Alves dos Santos

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

common_words = 0
p_words = {}

for i in range(n):
    p_words[input()] = True

for i in range(m):
    if (input() in p_words):
        common_words += 1

print("NO") if ((m > n) or ((n == m) and (common_words % 2 == 0))) else print("YES")
69c810ceebf55e1b6de81af953d55f24c8123ef2
<mask token>

<mask token>
for i in range(n):
    p_words[input()] = True
for i in range(m):
    if input() in p_words:
        common_words += 1
print('NO') if m > n or n == m and common_words % 2 == 0 else print('YES')

n, m = map(int, input().split())
common_words = 0
p_words = {}
for i in range(n):
    p_words[input()] = True
for i in range(m):
    if input() in p_words:
        common_words += 1
print('NO') if m > n or n == m and common_words % 2 == 0 else print('YES')

# @author Matheus Alves dos Santos

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

common_words = 0
p_words = {}

for i in range(n):
    p_words[input()] = True

for i in range(m):
    if (input() in p_words):
        common_words += 1

print("NO") if ((m > n) or ((n == m) and (common_words % 2 == 0))) else print("YES")