#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  set<string> sett;
  if (n > m) {
    cout << "YES";
    return 0;
  }
  if (n < m) {
    cout << "NO";
    return 0;
  }
  while (n--) {
    string s;
    cin >> s;
    sett.insert(s);
  }
  int count = 0;
  while (m--) {
    string s;
    cin >> s;
    if (sett.count(s) != 0) count++;
  }
  if (count % 2 != 0)
    cout << "YES";
  else
    cout << "NO";
}
