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