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