#include <bits/stdc++.h>
const int inf = (1ll << 30) - 1;
const int maxn = (int)1e5 + 10;
const int mod = (int)1e9 + 7;
using namespace std;
int n, m;
string second[100100];
void solve() {
  cin >> n >> m;
  for (int i = 0; i < n + m; i++) cin >> second[i];
  sort(second, second + n + m);
  int cnt = 0;
  for (int i = 1; i < n + m; i++) {
    if (second[i] == second[i - 1]) cnt++;
  }
  n -= cnt;
  m -= cnt;
  n += (cnt + 1) / 2;
  m += cnt / 2;
  if (n > m)
    cout << "YES\n";
  else
    cout << "NO\n";
}
int main() {
  int t = 1;
  for (int i = 1; i <= t; i++) {
    solve();
  }
  return 0;
}
