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