#include <bits/stdc++.h>
using namespace std;
string s1, s2;
int ac, bc;
int main() {
  cin >> s1 >> s2;
  for (int i = 0; i < s1.size(); i++) {
    if (s1[i] == '1') ac++;
  }
  for (int i = 0; i < s2.size(); i++) {
    if (s2[i] == '1') bc++;
  }
  if ((ac % 2 == 0 && bc > ac) || ac + 1 < bc) return 0 * printf("NO");
  if (ac + 1 >= bc) return 0 * printf("YES");
  return 0;
}
