#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int N = 1e5 + 5;
const float pi = 3.14159265358979323;
const long long inf = 1e18 + 5;
const long double eps = pow(2, -52);
int n, m;
string test;
map<string, int> p1, p2;
int main() {
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> test, p1[test]++;
  for (int i = 0; i < m; i++) cin >> test, p2[test]++;
  int common = 0;
  map<string, int>::iterator it;
  for (it = p1.begin(); it != p1.end(); it++)
    if (p2.find(it->first) != p2.end()) common++;
  int turn;
  if (common % 2)
    turn = 2;
  else
    turn = 1;
  n -= common;
  m -= common;
  if (turn == 1) {
    if (n > m)
      cout << "YES";
    else
      cout << "NO";
  } else {
    if (n >= m)
      cout << "YES";
    else
      cout << "NO";
  }
}
