#include <bits/stdc++.h>
using namespace std;
int a[100005];
int main() {
  int n, m, i, j, k, l;
  string s1, s2;
  cin >> s1;
  cin >> s2;
  int c1 = 0, c2 = 0;
  ;
  for (i = 0; i < s1.size(); i++) {
    if (s1[i] == '1') c1++;
  }
  for (i = 0; i < s2.size(); i++) {
    if (s2[i] == '1') c2++;
  }
  if (c1 & 1) {
    if (c2 > c1 + 1)
      printf("NO");
    else
      printf("YES");
  } else {
    if (c2 > c1)
      printf("NO");
    else
      printf("YES");
  }
  return 0;
}
