#include <bits/stdc++.h>
using namespace std;
string a, b;
int main() {
  cin >> a >> b;
  int n = b.length();
  int n1 = a.length();
  int cnt = 0;
  for (int i = 0; i < n1; i++) {
    if (a[i] == '1') cnt++;
  }
  int ct1 = 0;
  for (int i = 0; i < n; i++) {
    if (b[i] == '1') ct1++;
  }
  if (cnt % 2 != 0) cnt++;
  if (cnt >= ct1)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
