#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
const long long MAXN = 2005, Mo = 1000000007;
char s[MAXN], ch;
long long n, m, a[MAXN], b[MAXN];
int main() {
  long long i, j, k;
  n = read();
  m = read();
  for (i = 1; i <= n; ++i) {
    scanf("%s", s + 1);
    k = strlen(s + 1);
    for (j = 1, a[i] = 0; j <= k; ++j)
      a[i] = (a[i] * 997 + s[j] - 'A' + 1) % Mo;
  }
  for (i = 1; i <= m; ++i) {
    scanf("%s", s + 1);
    k = strlen(s + 1);
    for (j = 1, b[i] = 0; j <= k; ++j)
      b[i] = (b[i] * 997 + s[j] - 'A' + 1) % Mo;
  }
  for (i = 1, k = 0; i <= n; ++i)
    for (j = 1; j <= m; ++j)
      if (a[i] == b[j]) {
        k++;
        break;
      }
  n = n - k;
  m = m - k;
  n = n + (k + 1) / 2;
  m = m + k / 2;
  if (n > m)
    printf("YES\n");
  else
    printf("NO\n");
  return 0;
}
