You are fishing with polar bears Alice and Bob. While waiting for the fish to bite, the polar bears get bored. They come up with a game. First Alice and Bob each writes a 01-string (strings that only contain character "0" and "1") a and b. Then you try to turn a into b using two types of operations:  Write parity(a) to the end of a. For example, $1010 \rightarrow 10100$.  Remove the first character of a. For example, $1001 \rightarrow 001$. You cannot perform this operation if a is empty. 

You can use as many operations as you want. The problem is, is it possible to turn a into b?

The parity of a 01-string is 1 if there is an odd number of "1"s in the string, and 0 otherwise.


-----Input-----

The first line contains the string a and the second line contains the string b (1 ≤ |a|, |b| ≤ 1000). Both strings contain only the characters "0" and "1". Here |x| denotes the length of the string x.


-----Output-----

Print "YES" (without quotes) if it is possible to turn a into b, and "NO" (without quotes) otherwise.


-----Examples-----
Input
01011
0110

Output
YES

Input
0011
1110

Output
NO



-----Note-----

In the first sample, the steps are as follows: 01011 → 1011 → 011 → 0110

Difficulty: competition

Starter code:

Solutions:
print('YES' if input().count('1')+1>>1<<1 >= input().count('1') else 'NO')

a, b = input(), input()
x, y = a.count('1'), b.count('1')
print('YNEOS'[x + (x & 1) < y :: 2])

a = input()
b = input()

if ((a.count('1') + 1) // 2 * 2) >= b.count('1'):
    print("YES")
else:
    print("NO")

a = input().rstrip()
b = input().rstrip()
cnta = 0
cntb = 0
for i in a:
    if i == "1":
        cnta += 1
for i in b:
    if i == "1":
        cntb += 1
if cntb - cnta > 1 or (cntb - cnta == 1 and cnta % 2 == 0):
    print("NO")
    return
else:
    print("YES")

a = (input().count('1') + 1) // 2
b = (input().count('1') + 1) // 2
print('YES' if a >= b else 'NO')

def main():
    a, b = (input().count('1') for _ in "ab")
    print(("NO", "YES")[a + (a & 1) >= b])


def __starting_point():
    main()

__starting_point()

a, b = input(), input()
ax = sum([ord(c) - ord('0') for c in a])
bx = sum([ord(c) - ord('0') for c in b])
print("YES" if bx <= ax + ax % 2 else "NO")

ax, bx = 0, 0
for c in input():
 if c == '1':
  ax += 1
for c in input():
 if c == '1':
  bx += 1
print("YES" if bx <= ax + ax % 2 else "NO")

a=input()
print('YES'if a.count('1')+(a.count('1')&1)>=input().count('1')else'NO')

n = input().count('1')
m = input().count('1')
print('YNEOS'[n + (n & 1) < m::2])


a = list(input())
b = list(input())

print(['NO', 'YES'][a.count('1')+a.count('1')%2 >= b.count('1')])

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
a=[]
b=[]
a=input()
b=input()
cnta=0
cntb=0
for i,val in enumerate(a):
    if val=='1':
        cnta=cnta+1
for i,val in enumerate(b):
    if val=='1':
        cntb=cntb+1
if cnta&1==1:
    cnta=cnta+1
if cnta>=cntb:
    print('YES')
else:
    print('NO')

a=input()

print('YES'if a.count('1')+(a.count('1')&1)>=input().count('1')else'NO')

a=input()
b=input()

acount=a.count('1')
bcount=b.count('1')

if (acount % 2 == 1):
	acount += 1

if (acount >= bcount):
	print('YES')
else:
	print('NO')

def yesOrNo(a,b):
    x = a.count('1')
    y = b.count('1')
    if x%2 == 1:
        x+=1
    if x < y:
        return "NO"
    else:
        return "YES"
a = input()
b = input()
print(yesOrNo(a,b))


a = input()
b = input()

sa = 0
for s in a:
	if s == '1':
		sa += 1

sb = 0
for s in b:
	if s == '1':
		sb += 1

if sa >= sb:
	print("YES")
else:
	if sb%2 == 0:
		if sa == sb-1:
			print("YES")
		else:
			print("NO")
	else:
		print("NO")

def play(s, t):
    count1, count2 = 0, 0
    for elem in s:
        if elem == '1':
            count1 += 1
    for elem in t:
        if elem == '1':
            count2 += 1
    if count2 - count1 > 1 or (count2 - count1 == 1 and count1 % 2 == 0):
        return "NO"
    return "YES"


a = input()
b = input()
print(play(a, b))


A = list(input())
B = list(input())

zA = A.count('1')
zA += zA & 1

if zA >= B.count('1'):
    print("YES")
else:
    print("NO")

def maxConsecutive(a):
    i = 1
    curr = 0
    if a[0] == '1':
        curr += 1
    ans = curr
    for i in range(len(a)):
        if a[i] == '1':
            curr += 1
        else:
            curr = 1
        ans = max(ans, curr)
    return ans

def countOne(a):
    ans = 0
    for i in range(len(a)):
        if a[i] == '1':
            ans += 1
    return ans

a = input()
b = input()
if countOne(a) + countOne(a)%2 >= countOne(b):
    print("YES")
else:
    print("NO")

# 101101
#       01111


s=input()
t=input()
a=s.count('1')
b=t.count('1')
if a%2==0:
    if b<=a:
        print("YES")
    else:
        print("NO")
else:
    if b<=a+1:
        print("YES")
    else:
        print("NO")                

a = input()
b = input()
cnt1 = a.count('1') + (a.count('1') % 2 == 1)
cnt2 = b.count('1')
print('YES'if cnt1 >= cnt2 else'NO')


a=input()
b=input()
coa=0
cob=0
for i in a:
    if i=='1': coa+=1
for i in b:
    if i=='1': cob+=1

if coa+(coa&1)>=cob:print('YES')
else:print('NO')


a, b = input(), input()
ca = a.count('1')
cb = b.count('1')
if ca + ca % 2 >= cb:
    print('YES')
else:
    print('NO')

alice = input()
bob = input()

a = alice.count('1') 
b = bob.count('1')
a += (a%2) # if it is odd, then add another one.

print("YES" if a >= b else "NO")