#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, same = 0;
  string a[1005], b[1005];
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < m; i++) {
    cin >> b[i];
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (a[i] == b[j]) same++;
    }
  }
  m -= same % 2;
  if (n > m)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
