You are given two strings, A and B. Find if there is a substring that appears in both A and B.

Input

The first line of the input will contain a single integer T, the number of test cases.

Then there will be T descriptions of the test cases. Each description contains two lines. The first line contains the string A and the second line contains the string B.

OUTPUT

For each test case, display YES (in a newline), if there is a common substring. Otherwise, display NO.

CONSTRAINTS

All the strings contain only lowercase Latin letters.
1 ≤ T ≤ 10
1 ≤ |A|,|B| ≤ 10^5

SAMPLE INPUT
2
hello
world
hi
world

SAMPLE OUTPUT
YES
NO

Explanation

For the 1st test case, the letter o is common between both strings, hence the answer YES.

For the 2nd test case, hi and world do not have a common substring, hence the answer NO.
t=int(raw_input())
l=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
for i in range(0,t):
	flg=0
	s1=list(raw_input())
	s2=list(raw_input())
	for k in range(0,26):
		if(l[k] in s1 and l[k] in s2):
			flg=1
			break
	if(flg==1):
		print "YES"
	else:
		print "NO"