#include <bits/stdc++.h>
using namespace std;
string s;
set<string> u;
int n, m, cnt;
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) {
    cin >> s;
    u.insert(s);
  }
  for (int i = 0; i < m; i++) {
    cin >> s;
    if (u.find(s) != u.end()) cnt++;
  }
  n = (n - cnt) + cnt % 2, m = m - cnt;
  printf("%s", n > m ? "YES" : "NO");
  return 0;
}
