#include <bits/stdc++.h>
using namespace std;
string pb[1001], eb[1001];
int main() {
  int n, m, same = 0;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) cin >> pb[i];
  for (int i = 0; i < m; i++) cin >> eb[i];
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      if (pb[i] == eb[j]) same++;
  n -= same;
  m -= same;
  if (same % 2 == 0) {
    if (n > m)
      printf("YES\n");
    else
      printf("NO\n");
  } else {
    if (n >= m)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
