#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 5;
int main() {
  int n, m, tmp = 0;
  cin >> n >> m;
  map<string, bool> mp;
  vector<string> poland, enemy;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    poland.push_back(s);
    mp[s] = 1;
  }
  for (int i = 0; i < m; i++) {
    string s;
    cin >> s;
    enemy.push_back(s);
    if (mp[s]) tmp++;
  }
  n -= tmp;
  m -= tmp;
  if (tmp % 2) n++;
  if (n <= m)
    cout << "NO" << endl;
  else
    cout << "YES" << endl;
  return 0;
}
