#include <bits/stdc++.h>
using namespace std;
int n, m;
char s1[1010], s2[1010];
int main() {
  int i, j, st1, st2, len1, len2;
  while (scanf("%s %s", s1, s2) != EOF) {
    st1 = st2 = 0;
    len1 = strlen(s1);
    len2 = strlen(s2);
    for (i = 0; i < len1; i++)
      if (s1[i] == '1') st1++;
    for (i = 0; i < len2; i++)
      if (s2[i] == '1') st2++;
    if (st1 >= st2) {
      puts("YES");
      continue;
    }
    if (st1 + 1 < st2) {
      puts("NO");
    } else if (st1 & 1) {
      puts("YES");
    } else
      puts("NO");
  }
}
