#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) {
    int n, m;
    cin >> n >> m;
    std::map<string, int> mp;
    string str;
    for (int i = 0; i < n; ++i) {
      cin >> str;
      mp[str]++;
    }
    int common = 0;
    for (int i = 0; i < m; ++i) {
      cin >> str;
      if (mp[str]) ++common;
    }
    (common & 1) ? ((n >= m) ? cout << "YES\n" : cout << "NO\n")
                 : ((n > m) ? cout << "YES\n" : cout << "NO\n");
  }
  return 0;
}
