#include <bits/stdc++.h>
char a[1024], b[1024];
int ca, cb;
int main() {
  scanf("%s%s", a, b);
  int la = strlen(a), lb = strlen(b);
  for (int i = 0; i < la; i++)
    if (a[i] == '1') ++ca;
  for (int i = 0; i < lb; i++)
    if (b[i] == '1') ++cb;
  ca = (ca + 1) / 2;
  cb = (cb + 1) / 2;
  puts(ca >= cb ? "YES" : "NO");
  return 0;
}
