#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  set<string> p;
  set<string> a;
  set<string> b;
  for (int i = 0; i < n; ++i) {
    string s;
    cin >> s;
    a.insert(s);
  }
  for (int i = 0; i < m; ++i) {
    string s;
    cin >> s;
    auto it = b.begin();
    it = a.find(s);
    if (it != a.end()) {
      p.insert(s);
      a.erase(s);
    } else {
      b.insert(s);
    }
  }
  int a1 = a.size();
  int b1 = b.size();
  if (p.size() % 2 == 1) {
    a1++;
  }
  if (a1 > b1) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
  return 0;
}
