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