#include <bits/stdc++.h>
using namespace std;
int main() {
  set<string> s1, s2, s3;
  s3.clear();
  s1.clear();
  s2.clear();
  int n, m;
  cin >> n >> m;
  string str = "";
  for (int i = 0; i < n; i++) {
    cin >> str;
    s1.insert(str);
  }
  for (int i = 0; i < m; i++) {
    cin >> str;
    s2.insert(str);
  }
  set<string>::iterator it;
  for (it = s1.begin(); it != s1.end(); it++) {
    if (s2.find(*it) != s2.end()) {
      s3.insert(*it);
    }
  }
  int z = s3.size();
  int x = s1.size() - z;
  int y = s2.size() - z;
  if (z % 2 != 0) {
    if (x >= y) {
      cout << "YES\n";
    } else {
      cout << "NO\n";
    }
  } else {
    if (x - y >= 1)
      cout << "YES\n";
    else {
      cout << "NO\n";
    }
  }
  return 0;
}
