#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<string> data;
  for (int i = 0; i != n; ++i) {
    string x;
    cin >> x;
    data.push_back(x);
  }
  int count{0};
  for (int i = 0; i < m; ++i) {
    string x;
    cin >> x;
    for (string j : data) {
      if (j == x) ++count;
    }
  }
  n += count % 2;
  if (n > m)
    cout << "YES";
  else
    cout << "NO";
}
