#include <bits/stdc++.h>
char s1[1002][502];
char s2[1002][502];
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  int i;
  for (i = 1; i <= n; i++) scanf("%s", s1[i]);
  for (i = 1; i <= m; i++) scanf("%s", s2[i]);
  int j, cnt = 0;
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= m; j++) {
      int k = 0;
      int f = 0;
      if (strlen(s1[i]) == strlen(s2[j])) {
        while (s1[i][k] != '\0' && s2[j][k] != '\0') {
          if (s1[i][k] != s2[j][k]) {
            f = 1;
            break;
          }
          k++;
        }
        if (k == strlen(s1[i])) cnt++;
      }
    }
  }
  if (n > m) {
    printf("YES\n");
    return 0;
  }
  if (m > n) {
    printf("NO\n");
  }
  if (n == m && cnt == 0) {
    printf("NO\n");
    return 0;
  }
  if (n == m && cnt % 2 == 1) {
    printf("YES\n");
  }
  if (n == m && cnt % 2 == 0) {
    printf("NO\n");
    return 0;
  }
}
