#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  while (cin >> n >> m) {
    map<string, int> mp;
    string str;
    int cnt = 0;
    for (int i = 0; i < n; i++) {
      cin >> str;
      mp[str]++;
    }
    for (int i = 0; i < m; i++) {
      cin >> str;
      mp[str]++;
      if (mp[str] == 2) cnt++;
    }
    if (n > m) {
      cout << "YES" << endl;
    } else if (m > n) {
      cout << "NO" << endl;
    } else if (m == n) {
      if (cnt == 0)
        cout << "NO" << endl;
      else if (cnt % 2 == 1)
        cout << "YES" << endl;
      else if (cnt % 2 == 0)
        cout << "NO" << endl;
    }
  }
  return 0;
}
