#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, m;
  cin >> n >> m;
  map<string, int> m1;
  map<string, int> m2;
  vector<string> v1, v2, v3;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    v1.push_back(s);
  }
  for (int i = 0; i < m; i++) {
    string s;
    cin >> s;
    v2.push_back(s);
  }
  sort(v1.begin(), v1.end());
  sort(v2.begin(), v2.end());
  if (v1.size() > v2.size()) {
    cout << "YES" << endl;
  } else if (v1.size() < v2.size())
    cout << "NO" << endl;
  else {
    set_intersection(v1.begin(), v1.end(), v2.begin(), v2.end(),
                     back_inserter(v3));
    if (v3.size() % 2 != 0)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
