#include <bits/stdc++.h>
using namespace std;
const int Max = 1e3;
string s1[Max], s2[Max];
bool vis1[Max + 10], vis2[Max + 10];
int main() {
  cin.sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> s1[i];
  for (int j = 0; j < m; j++) cin >> s2[j];
  int sum1 = 0, sum2 = 0, sum3 = 0;
  for (int i = 0; i < n; i++) {
    bool flag = true;
    for (int j = 0; j < m; j++) {
      if (s1[i] == s2[j]) {
        sum3++;
        flag = false;
        break;
      }
    }
    if (flag) sum1++;
  }
  sum2 = m - sum3;
  if (sum3 % 2) sum1++;
  if (sum1 > sum2)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
