#include <bits/stdc++.h>
using namespace std;
FILE *f, *g;
char A[1010], B[1010];
int na, nb, i, cn1, cn2;
int main() {
  scanf("%s", A);
  scanf("%s", B);
  na = strlen(A);
  nb = strlen(B);
  for (i = 0; i < na; i++)
    if (A[i] == '1') cn1++;
  for (i = 0; i < nb; i++)
    if (B[i] == '1') cn2++;
  if (cn2 - cn1 >= 2) {
    printf("NO");
    return 0;
  }
  if (cn1 - cn2 >= 2) {
    printf("YES");
    return 0;
  }
  if (cn1 % 2 == 0) {
    if (cn2 > cn1)
      printf("NO");
    else
      printf("YES");
  } else {
    printf("YES");
  }
  return 0;
}
