#include <bits/stdc++.h>
using namespace std;
int n, m, x[1004], y[1004];
string a[1004], b[1004];
int main() {
  cin.sync_with_stdio(false);
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < m; i++) cin >> b[i];
  sort(a, a + n);
  sort(b, b + m);
  for (int i = 0, j = 0; i < n; i++) {
    while (j < m and a[i] > b[j]) j++;
    if (j < m and a[i] == b[j]) x[i] = y[j] = 1;
  }
  int ao = 0, ax = 0, bo = 0, bx = 0;
  for (int i = 0; i < n; i++) {
    if (x[i])
      ao++;
    else
      ax++;
  }
  for (int i = 0; i < m; i++) {
    if (y[i])
      bo++;
    else
      bx++;
  }
  bool yes;
  if (ao & 1)
    yes = (ax >= bx);
  else
    yes = (ax > bx);
  cout << (yes ? "YES" : "NO");
}
