#include <bits/stdc++.h>
using namespace std;
string str1, str2;
int main() {
  int n;
  cin >> str1;
  cin >> str2;
  int ctr1 = 0;
  int ctr2 = 0;
  if (str1 == str2) {
    cout << "YES\n";
    return 0;
  } else {
    for (int i = 0; i < str1.length(); i++) {
      if (str1[i] == '1') ctr1++;
    }
    for (int i = 0; i < str2.length(); i++) {
      if (str2[i] == '1') ctr2++;
    }
  }
  if (((ctr1 & 1) == 1) && (ctr2 <= (ctr1 + 1)))
    cout << "YES\n";
  else if (ctr2 <= ctr1)
    cout << "YES\n";
  else
    cout << "NO\n";
  return 0;
}
