#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  ;
  int p, e;
  cin >> p >> e;
  int dup = 0;
  unordered_map<string, int> um;
  for (int i = 0; i < p; i++) {
    string s;
    cin >> s;
    um[s]++;
  }
  for (int i = 0; i < e; i++) {
    string s;
    cin >> s;
    um[s]++;
    if (um[s] == 2) dup++;
  }
  bool po;
  (dup % 2 == 0) ? po = 1 : po = 0;
  if (p == e)
    (po) ? cout << "NO" : cout << "YES";
  else if (p > e)
    cout << "YES";
  else
    cout << "NO";
}
