The Bitlandians are quite weird people. They do everything differently. They have a different alphabet so they have a different definition for a string.

A Bitlandish string is a string made only of characters "0" and "1".

BitHaval (the mayor of Bitland) loves to play with Bitlandish strings. He takes some Bitlandish string a, and applies several (possibly zero) operations to it. In one operation the mayor may take any two adjacent characters of a string, define one of them as x and the other one as y. Then he calculates two values p and q: p = x xor y, q = x or y. Then he replaces one of the two taken characters by p and the other one by q.

The xor operation means the bitwise excluding OR operation. The or operation is the bitwise OR operation.

So for example one operation can transform string 11 to string 10 or to string 01. String 1 cannot be transformed into any other string.

You've got two Bitlandish strings a and b. Your task is to check if it is possible for BitHaval to transform string a to string b in several (possibly zero) described operations.


-----Input-----

The first line contains Bitlandish string a, the second line contains Bitlandish string b. The strings can have different lengths.

It is guaranteed that the given strings only consist of characters "0" and "1". The strings are not empty, their length doesn't exceed 10^6.


-----Output-----

Print "YES" if a can be transformed into b, otherwise print "NO". Please do not print the quotes.


-----Examples-----
Input
11
10

Output
YES

Input
1
01

Output
NO

Input
000
101

Output
NO

Difficulty: interview

Starter code:

Solutions:
I=input;a,b=I(),I();print("YNEOS"[len(a)!=len(b)or"1"in set(a)^set(b)::2])


S1 = input()
S2 = input()
if (len(S1) == len(S2)) and ((S1.count('1') == 0 and S2.count('1') == 0) or (S1.count('1') != 0 and S2.count('1') != 0)):
	print ('YES')
else:
	print ('NO')

3

a = input()
b = input()
if len(a) != len(b) or (a.find('1') == -1) ^ (b.find('1') == -1):
    print('NO')
else:
    print('YES')


import sys

first = sys.stdin.readline().strip()
second = sys.stdin.readline().strip()

if len(first) != len(second):
    print("NO")
    return

count1, count2 = 0, 0
for i in first:
    if i == '1':
        count1 += 1
for i in second:
    if i == '1':
        count2 += 1

if (count1 == 0 and count2 != 0) or \
  (count1 != 0 and count2 == 0):
  print("NO")
  return

print("YES")


a, b = input(), input()

print("NO" if ((len(a) != len(b) or '1' not in a or '1' not in b) and a != b) else 'YES')


a, b = input(), input()
if len(a) != len(b): print('NO')
else:
    u, v = 0, 0
    for i in a: 
        if i == '1':
            u = 1
            break
    for i in b: 
        if i == '1':
            v = 1
            break                 
    if u == v: print('YES')
    else: print('NO')

a, b = input(), input()
if len(a) != len(b): print('NO')
else: print('NO' if ('1' in a) ^ ('1' in b) else 'YES')

s1 = input()
s2 = input()
if ('1' in s1 and '1' not in s2) or ('1' in s2 and '1' not in s1) or len(s1) != len(s2):
    print('NO')
else:
    print('YES')

str1 = input()
str2 = input()

if len(str1) != len(str2):
    print("NO")
    
else:
    if ('1' in str1) ^ ('1' in str2):
        print("NO")
    else:
        print("YES")


a, b = input(), input()
print('YES' if len(a) == len(b) and ('1' in a) == ('1' in b) else 'NO')

a = input()
b = input()
n = len(a)
if n != len(b):
	print('NO')
	return
if n == 1 and a != b:
	print('NO')
	return
if (a.count('1') > 0) == (b.count('1') > 0):
	print('YES')
else:
	print('NO')


i=input;a,b=i(),i();print(["YES","NO"][(len(a)!=len(b) or set(a)=={'0'} or set(b) == {'0'} or len(a)<2) and a!=b])

x=list(input())
y=list(input())
if len(x)!=len(y):
    print('NO')
    raise SystemExit
    
if x.count('1')==0 and y.count('1')==0:
    print('YES')
    raise SystemExit

if x.count('1')>0 and y.count('1')>0:
    print('YES')
    raise SystemExit    
    
print('NO')

a = input()
b = input()
n = len(a)
if n != len(b):
    print('NO')
    return
if n == 1 and a != b:
    print('NO')
    return
if (a.count('1') > 0) == (b.count('1') > 0):
    print('YES')
else:
    print('NO')

a = input()
b = input()

if len(a) != len(b):
   print('NO')
elif a == b:
   print('YES')
else:
   s = '0'*len(a)
   if a == s or b == s:
      print('NO')
   else:
      print('YES')

s1 = input()
s2 = input()
if len(s1) != len(s2):
    print("NO")
    return
elif len(s1) == 1:
    if s1 != s2:
        print("NO")
    else:
        print("YES")
    return
elif s1 == s2:
    print("YES")
    return
if (s1.count("1") != 0) and (s2.count("1") != 0):
    print("YES")
else:
    print("NO")


A = input()
B = input()
if(len(A)!=len(B)):
	print("NO")
else:
	A1 = "1" in A
	B1 = "1" in B
	if(A1 == B1):
		print("YES")
	else:
		print("NO")

a = input()
b = input()
print("YNEOS"[len(a) != len(b) or "1" in set(a) ^ set(b)::2])


def main():
    aa, bb = input(), input()
    print(("NO", "YES")[len(aa) == len(bb) and any(c == "1" for c in aa) == any(c == "1" for c in bb)])


def __starting_point():
    main()

__starting_point()

def main():
    aa, bb = input(), input()
    print(("NO", "YES")[len(aa) == len(bb) and ("1" in aa) == ("1" in bb)])


def __starting_point():
    main()

__starting_point()

str1=input()
str2=input()
import sys
x=False
y=False
if(len(str1)!=len(str2)or len(str1)==1and str1[0]!=str2[0]):
    print("NO")
    return
else:
    for i in range(0,len(str1)):
      if(str1[i]=="1"):
          x=True
      if(str2[i]=="1"):
          y=True
if(len(str1)==1 and str1[0]=="0"and str2[0]=="0"):
    print("YES")
    return
if x==True and y==True or x==False and y==False:
    print("YES")
else:
    print("NO")


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

if(len(a)!=len(b)):
    print("NO")
elif len(a) == 1:
    if a == b :
        print("YES")
    else:
        print("NO")
else:
    if a == b :
        print("YES")
    elif '1' in a and '1' in b :
        print("YES")
    else:
        print("NO")


a = input()
b = input()
if len(a) != len(b):
    print('NO')
else:
    if a == b:
        print('YES')
    elif '1' in a and '1' in b:
        print('YES')
    else:
        print('NO')