#include <bits/stdc++.h>
using namespace std;
char a[1005], b[1005];
int main() {
  scanf("%s%s", a, b);
  int cnt1 = 0, cnt2 = 0;
  int la = strlen(a);
  int lb = strlen(b);
  for (int i = 0; i < la; i++)
    if (a[i] == '1') cnt1++;
  for (int i = 0; i < lb; i++)
    if (b[i] == '1') cnt2++;
  if (cnt1 & 1) {
    if (cnt1 + 1 >= cnt2)
      printf("YES\n");
    else
      printf("NO\n");
  } else {
    if (cnt1 >= cnt2)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
