#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e3 + 5;
int na, nb, cnta, cntb;
bool sol;
char a[maxn], b[maxn];
int main() {
  scanf("%s", a);
  scanf("%s", b);
  na = strlen(a);
  nb = strlen(b);
  for (int i = 0; i < na; i++) cnta += (a[i] == '1');
  for (int i = 0; i < nb; i++) cntb += (b[i] == '1');
  if (cnta & 1) cnta++;
  if (cntb <= cnta)
    printf("YES\n");
  else
    printf("NO\n");
  return 0;
}
