#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  while (a && b) a > b ? a %= b : b %= a;
  return a + b;
}
int LCM(int a, int b) { return (a * b) / gcd(a, b); }
const int INF = INT_MAX;
const long long INFL = LLONG_MAX;
int main() {
  std::ios::sync_with_stdio(0);
  cin.tie(0);
  string a, b;
  cin >> a >> b;
  int cnt = 0;
  for (int(i) = 0; (i) < (a.length()); (i)++) {
    if (a[i] == '1') cnt++;
  }
  if (cnt % 2) cnt++;
  for (int(i) = 0; (i) < (b.length()); (i)++) {
    if (b[i] == '1') cnt--;
  }
  if (cnt >= 0) {
    cout << "YES" << '\n';
  } else
    cout << "NO" << '\n';
  return 0;
}
