#include <bits/stdc++.h>
using namespace std;
set<string> s;
int main() {
  int n, m;
  cin >> n >> m;
  string tmp;
  for (int i = 0; i < n; i++) {
    cin >> tmp;
    s.insert(tmp);
  }
  int match = 0;
  for (int j = 0; j < m; j++) {
    cin >> tmp;
    if (s.find(tmp) != s.end()) {
      match++;
    }
  }
  n -= (match) / 2;
  m -= (match) / 2;
  if (match % 2 == 1) {
    n++;
  }
  if (n > m) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
  return 0;
}
