#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  while (cin >> n >> m) {
    set<string> s1;
    string a;
    for (int i = 0; i < n; i++) {
      cin >> a;
      s1.insert(a);
    }
    for (int i = 0; i < m; i++) {
      cin >> a;
      s1.insert(a);
    }
    if (n > m)
      cout << "YES" << endl;
    else if (n < m)
      cout << "NO" << endl;
    else {
      if ((n + m - s1.size()) % 2 == 1)
        cout << "YES" << endl;
      else
        cout << "NO" << endl;
    }
  }
  return 0;
}
