#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  long long c1 = 0, c2 = 0;
  string s1, s2;
  cin >> s1 >> s2;
  long long n = max(s1.size(), s2.size());
  for (long long i = 0; i < n; i++) {
    if (i < s1.size() && s1[i] == '1') c1++;
    if (i < s2.size() && s2[i] == '1') c2++;
  }
  if (c2 <= c1)
    cout << "YES";
  else if ((c1 % 2 == 1 && c1 + 1 == c2))
    cout << "YES";
  else
    cout << "NO";
}
