#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  set<string> seta;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    seta.insert(s);
  }
  set<string> setb;
  for (int i = 0; i < m; i++) {
    string s;
    cin >> s;
    setb.insert(s);
  }
  int c = 0;
  for (auto p : seta) {
    if (setb.find(p) != setb.end()) {
      c++;
    }
  }
  int a = n - c;
  int b = m - c;
  if (c % 2 == 0) {
    if (a > b) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  } else {
    if (a < b) {
      cout << "NO" << endl;
    } else {
      cout << "YES" << endl;
    }
  }
}
