You are given two arrays of integers $a_1,\ldots,a_n$ and $b_1,\ldots,b_m$.

Your task is to find a non-empty array $c_1,\ldots,c_k$ that is a subsequence of $a_1,\ldots,a_n$, and also a subsequence of $b_1,\ldots,b_m$. If there are multiple answers, find one of the smallest possible length. If there are still multiple of the smallest possible length, find any. If there are no such arrays, you should report about it.

A sequence $a$ is a subsequence of a sequence $b$ if $a$ can be obtained from $b$ by deletion of several (possibly, zero) elements. For example, $[3,1]$ is a subsequence of $[3,2,1]$ and $[4,3,1]$, but not a subsequence of $[1,3,3,7]$ and $[3,10,4]$.


-----Input-----

The first line contains a single integer $t$ ($1\le t\le 1000$)  — the number of test cases. Next $3t$ lines contain descriptions of test cases.

The first line of each test case contains two integers $n$ and $m$ ($1\le n,m\le 1000$)  — the lengths of the two arrays.

The second line of each test case contains $n$ integers $a_1,\ldots,a_n$ ($1\le a_i\le 1000$)  — the elements of the first array.

The third line of each test case contains $m$ integers $b_1,\ldots,b_m$ ($1\le b_i\le 1000$)  — the elements of the second array.

It is guaranteed that the sum of $n$ and the sum of $m$ across all test cases does not exceed $1000$ ($\sum\limits_{i=1}^t n_i, \sum\limits_{i=1}^t m_i\le 1000$).


-----Output-----

For each test case, output "YES" if a solution exists, or "NO" otherwise.

If the answer is "YES", on the next line output an integer $k$ ($1\le k\le 1000$)  — the length of the array, followed by $k$ integers $c_1,\ldots,c_k$ ($1\le c_i\le 1000$)  — the elements of the array.

If there are multiple solutions with the smallest possible $k$, output any.


-----Example-----
Input
5
4 5
10 8 6 4
1 2 3 4 5
1 1
3
3
1 1
3
2
5 3
1000 2 2 2 3
3 1 5
5 5
1 2 3 4 5
1 2 3 4 5

Output
YES
1 4
YES
1 3
NO
YES
1 3
YES
1 2



-----Note-----

In the first test case, $[4]$ is a subsequence of $[10, 8, 6, 4]$ and $[1, 2, 3, 4, 5]$. This array has length $1$, it is the smallest possible length of a subsequence of both $a$ and $b$.

In the third test case, no non-empty subsequences of both $[3]$ and $[2]$ exist, so the answer is "NO".

Difficulty: interview

Starter code:

Solutions:
for  testcases in range(int(input())):
	n,m = list(map(int,input().split()))
	ar = list(map(int,input().split()))
	br = list(map(int, input().split()))
	flag = 0 
	ans = 0
	for i in ar:
		for j in br:
			if i == j :
				ans = i 
				flag = 1
				break
	if flag == 0 :
		print("NO")
	else:
		print("YES")
		print(1,ans)				


t = int(input())

for _ in range(t):
    n, m = list(map(int, input().split()))

    a = list(map(int, input().split()))
    b = list(map(int, input().split()))

    ans = -1

    for x in a:
        for y in b:
            if x == y:
                ans = x

    if ans != -1:
        print('YES')
        print(1, ans)
    else:
        print('NO')


import random


def gcd(a, b):
    if a == 0:
        return b
    return gcd(b % a, a)


def lcm(a, b):
    return (a * b) / gcd(a, b)


for _ in range(int(input())):
    n,m=list(map(int,input().split()))
    a = list(map(int, input().split()))
    b = list(map(int, input().split()))
    f=-1
    a.sort()
    b.sort()
    d={}
    for i in a:
        d[i]=1
    for i in b:
        if i in d:
            f=i
    if (f==-1):
        print('NO')
    else:
        print('YES')
        print(1,f)


for _ in range(int(input())):
    n,m = map(int,input().split())
    a = list(map(int,input().split()))
    b = list(map(int,input().split()))
    ans="n"
    for i in a:
        for j in b:
            if i==j:
                ans=i
    if ans=='n':
        print("NO")
    else:
        print("YES")
        print("1",ans)

t=int(input())
for w in range(t):
    n,m=(int(i) for i in input().split())
    a=[int(i) for i in input().split()]
    b=[int(i) for i in input().split()]
    c=0
    for i in range(n):
        for j in range(m):
            if(b[j]==a[i]):
                c=1
                k=a[i]
                break
    if(c==0):
        print("NO")
    else:
        print("YES")
        print(1,k)