#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  set<string> a, b, both;
  string s;
  for (int i = 0; i < N; i++) {
    cin >> s;
    a.insert(s);
  }
  int both_know = 0;
  for (int i = 0; i < M; i++) {
    cin >> s;
    if (a.find(s) != a.end()) {
      both.insert(s);
    }
    b.insert(s);
  }
  while (1) {
    if (!both.empty()) {
      string x = *both.begin();
      both.erase(x);
      a.erase(x);
      b.erase(x);
    } else if (!a.empty()) {
      string x = *a.begin();
      a.erase(x);
    } else {
      cout << "NO" << endl;
      return 0;
    }
    if (!both.empty()) {
      string x = *both.begin();
      both.erase(x);
      a.erase(x);
      b.erase(x);
    } else if (!b.empty()) {
      string x = *b.begin();
      b.erase(x);
    } else {
      cout << "YES" << endl;
      return 0;
    }
  }
}
