#include <bits/stdc++.h>
using namespace std;
const int DBG = 0, INF = int(1e9);
int main() {
  ios_base::sync_with_stdio(0);
  cout.setf(ios::fixed);
  string a, b;
  cin >> a >> b;
  int x = count(a.begin(), a.end(), '1'), y = count(b.begin(), b.end(), '1');
  if ((x + 1) / 2 >= (y + 1) / 2)
    cout << "YES\n";
  else
    cout << "NO\n";
  return 0;
}
