#include <bits/stdc++.h>
using namespace std;
int n, m, cnt;
map<string, int> mymap;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    string st;
    cin >> st;
    ++mymap[st];
  }
  for (int i = 0; i < m; i++) {
    string st;
    cin >> st;
    ++mymap[st];
  }
  for (map<string, int>::iterator ii = mymap.begin(); ii != mymap.end(); ii++) {
    int sec = (*ii).second;
    if (sec == 2) ++cnt;
  }
  n -= cnt;
  m -= cnt;
  if (cnt & 1) {
    if (n < m)
      cout << "NO"
           << "\n";
    else
      cout << "YES"
           << "\n";
  } else {
    if (n > m)
      cout << "YES"
           << "\n";
    else
      cout << "NO"
           << "\n";
  }
  return 0;
}
