#include <bits/stdc++.h>
using namespace std;
int main() {
  string s, tomake;
  cin >> s;
  cin >> tomake;
  int cnt = count(s.begin(), s.end(), '1');
  int cntt = count(tomake.begin(), tomake.end(), '1');
  if (cnt >= cntt)
    cout << "YES\n";
  else {
    if (cntt - cnt == 1 && cnt & 1)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
  return 0;
}
