#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
const int inf = 1e9 + 1;
const double eps = 1e-15;
const double EPS = 1e-9;
const double PI = acos(-1.0);
int main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m;
  cin >> n >> m;
  set<string> p, e;
  string s;
  for (int i = 0; i < n; i++) {
    cin >> s;
    p.insert(s);
  }
  for (int i = 0; i < m; i++) {
    cin >> s;
    e.insert(s);
  }
  int cnt = 0;
  if (n == m) {
    for (auto it : p) {
      if (e.find(it) != e.end()) {
        cnt++;
      }
    }
    n -= cnt;
    m -= cnt;
    n += ((cnt + 1) / 2);
    m += ((cnt - (cnt + 1) / 2));
    cout << ((n > m) ? "YES\n" : "NO\n");
  } else if (n > m) {
    cout << "YES";
  } else
    cout << "NO";
  return 0;
}
