XOR or OR
Not waisting much of your time, Lets get to the question straight:
you have been given a string A containing of only 0's and 1's.
An operation is performed on string A.
The operation is described as:
two adjacent character (let it be x and y) is picked fron string A.
Characters 'p' and 'q' are formed using 'x' and 'y' as
p = x bitwise_xor y
q = x bitwise_or y
p replaces one among x and y, and q replaces the other one, in the original string to form a new string.
and, if x=1 and y=1
p= 1 xor 1 = 0
q= 1 or 1 = 1
so, string A now can be either 10 or 01.
The above operation can be applied on a string any number of times.
first line of input contains an integer T(number of test cases).
In each test case you will be provided with two strings, A and B comprising of only 0's and 1's.
each test case will be separated by a blank line.
if with any number of operation(maybe 0), we can form string B from string A.
print "YES", otherwise print "NO" on a separate line.
T <= 1500
length of A <= 100
length of B = length of A
Problem Setter: Sumit Kumar