#include <bits/stdc++.h>
using namespace std;
char a[1005], b[1005];
int lena, lenb;
int num[1005];
bool cal2() {
  int ca = num[0], cb = 0;
  for (int i = 0; i < lenb; ++i) cb += (b[i] == '1');
  if (ca + (ca & 1) >= cb)
    return true;
  else
    return false;
}
int main() {
  scanf("%s%s", a, b);
  lena = strlen(a);
  lenb = strlen(b);
  num[lena] = 0;
  for (int i = lena - 1; i >= 0; --i) {
    if (a[i] == '1')
      num[i] = num[i + 1] + 1;
    else
      num[i] = num[i + 1];
  }
  if (cal2())
    printf("YES\n");
  else
    printf("NO\n");
  return 0;
}
