#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int64_t n, m;
  cin >> n >> m;
  set<string> po, en, com;
  string s;
  for (int64_t i = 0; i < n; ++i) {
    cin >> s;
    po.insert(s);
  }
  for (int64_t i = 0; i < m; ++i) {
    string s;
    cin >> s;
    if (po.count(s))
      com.insert(s), po.erase(po.find(s));
    else
      en.insert(s);
  }
  while (1) {
    if (com.size() > 0) {
      com.erase(com.begin());
    } else if (po.size() > 0) {
      po.erase(po.begin());
    } else if (po.size() == 0)
      return cout << "NO", 0;
    if (com.size() > 0) {
      com.erase(com.begin());
    } else if (en.size() > 0) {
      en.erase(en.begin());
    } else if (en.size() == 0)
      return cout << "YES", 0;
  }
}
