#include <bits/stdc++.h>
using namespace std;
int main() {
  string str;
  set<string> pbSet;
  int i = 0, j = 0, k = 0, tmp1 = 0, tmp2 = 0, tmp3 = 0, tmp = 0, tmp4 = 0,
      tmp5 = 0, flag = 0;
  int common = 0, pbUn = 0, ebUn = 0;
  int n, m;
  scanf("%d %d\n", &n, &m);
  for (i = 0; i < n; i++) {
    cin >> str;
    pbSet.insert(str);
  }
  for (i = 0; i < m; i++) {
    cin >> str;
    if (pbSet.find(str) != pbSet.end())
      common++;
    else
      ebUn++;
  }
  pbUn = n - common;
  if (common % 2 == 0) {
    if (pbUn > ebUn)
      printf("YES\n");
    else
      printf("NO\n");
  } else {
    if (pbUn >= ebUn)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
