#include <bits/stdc++.h>
int main() {
  int n, m;
  int i, j, sum;
  char word[1005][505], temp[505];
  scanf("%d%d", &n, &m);
  sum = 0;
  for (i = 0; i < n; i++) scanf("%s", &word[i]);
  for (i = 0; i < m; i++) {
    scanf("%s", temp);
    for (j = 0; j < n; j++)
      if (strcmp(word[j], temp) == 0) sum++;
  }
  if (sum % 2 == 1) n++;
  if (n > m) printf("YES\n");
  if (n <= m) printf("NO\n");
  return 0;
}
