#include <bits/stdc++.h>
int main() {
  char a[1001], b[1001];
  scanf("%s%s", a, b);
  int c1 = 0, n1 = 0;
  for (int i = 0; i < strlen(a); i++)
    if (a[i] == '1') c1++;
  for (int i = 0; i < strlen(b); i++)
    if (b[i] == '1') n1++;
  int flag = 0;
  if (c1 >= n1)
    flag = 1;
  else {
    if (c1 % 2 && n1 == c1 + 1) flag = 1;
  }
  if (flag)
    printf("YES\n");
  else
    printf("NO\n");
}
