#include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 30;
const double EPS = 1e-7;
const int MAXN = 100010;
int dir[MAXN];
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
map<pair<int, int>, int> dst;
int cant1(string s) {
  int ans = 0;
  for (int i = 0; i < (int)s.length(); i++)
    if (s[i] == '1') ans++;
  return ans;
}
int main() {
  ios::sync_with_stdio(false);
  string s1, s2;
  cin >> s1 >> s2;
  int c1 = cant1(s1);
  int c2 = cant1(s2);
  if (c1 % 2 == 1 && c2 > c1) {
    if (c2 == c1 + 1)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  } else {
    if (c2 > c1)
      cout << "NO" << endl;
    else
      cout << "YES" << endl;
  }
  return 0;
}
