#include <bits/stdc++.h>
using namespace std;
set<string> bothSet(set<string>& first, set<string>& second) {
  set<string> result;
  set<string>::iterator it = second.begin();
  while (it != second.end()) {
    if (first.count(*it) == 1) {
      result.insert(*it);
    }
    it++;
  }
  return result;
}
set<string> only(set<string>& first, set<string>& second) {
  set<string> result;
  set<string>::iterator it1 = first.begin();
  while (it1 != first.end()) {
    result.insert(*it1);
    it1++;
  }
  set<string>::iterator it2 = second.begin();
  while (it2 != second.end()) {
    result.erase(*it2);
    it2++;
  }
  return result;
}
void printSet(set<string>& s) {
  set<string>::iterator it = s.begin();
  while (it != s.end()) {
    cout << *it << " ";
    it++;
  }
}
int main() {
  int n, m;
  cin >> n >> m;
  set<string> s1;
  set<string> s2;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    s1.insert(s);
  }
  for (int i = 0; i < m; i++) {
    string s;
    cin >> s;
    s2.insert(s);
  }
  set<string> onlyFirst = only(s1, s2);
  set<string> onlySecond = only(s2, s1);
  set<string> both = bothSet(s1, s2);
  if (onlyFirst.size() < onlySecond.size() ||
      (onlyFirst.size() == onlySecond.size() && both.size() % 2 == 0)) {
    cout << "NO" << endl;
  } else {
    cout << "YES" << endl;
  }
  return 0;
}
