#include <bits/stdc++.h>
using namespace std;
const int MaxN = 1000;
string a[MaxN + 5];
string b[MaxN + 5];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i <= m; i++) cin >> b[i];
  if (n == m) {
    int cnt = 0;
    for (int i = 1; i <= n; i++) {
      for (int j = 1; j <= n; j++) {
        if (a[i] == b[j]) cnt++;
      }
    }
    if (cnt != n) {
      if (cnt % 2 == 1) {
        printf("Yes\n");
      } else {
        printf("No\n");
      }
    } else {
      n % 2 ? printf("Yes\n") : printf("No\n");
    }
  } else
    m > n ? printf("No\n") : printf("Yes\n");
}
