#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int m, n, common = 0;
  cin >> n >> m;
  string s;
  vector<string> vs;
  for (int i = 0; i < n; i++) {
    cin >> s;
    vs.push_back(s);
  }
  for (int i = 0; i < m; i++) {
    cin >> s;
    if (find(vs.begin(), vs.end(), s) != vs.end()) common++;
  }
  if (common % 2 == 0) {
    if (n - common > m - common)
      cout << "YES";
    else
      cout << "NO";
  } else {
    if (n - common > m - common - 1)
      cout << "YES";
    else
      cout << "NO";
  }
  return 0;
}
