Chef has a sequence of $N$ integers, $A_1, A_2, ... , A_N$. He likes this sequence if it contains a  subsequence of $M$ integers, $B_1, B_2, ... , B_M$ within it.
A subsequence is a sequence that can be derived from another sequence by deleting some or no elements without changing the order of the remaining elements.
You will be given a sequence of $N$ integers, $A_1, A_2, ..., A_N$ followed by another sequence of $M$ integers, $B_1, B_2, ..., B_M$. Given these, you have to tell whether Chef likes the sequence of $N$ integers($A_1, A_2, ..., A_N$) or not. 
Formally, output "Yes" if
$\exists idx_1, idx_2, ..., idx_M | 1 \le idx_1 < idx_2 < ... < idx_M \le N$ and $A_{idx_i} = B_i \forall i, 1 \le i \le M$
Otherwise output "No". Note that the quotes are for clarity.

-----Input-----
The first line contains a single integer, $T$.
$T$ test cases follow where each test case contains four lines:
- The first line of a test case contains a single integer $N$
- The second line of the test case contains $N$ space separated integers, $A_1, A_2, ..., A_N$
- The third line of the test case contains a single integer $M$.
- The fourth line contains $M$ space separated integers, $B_1, B_2, ..., B_M$
Symbols have usual meanings as described in the statement.

-----Output-----
For each test case, output a single line containing the output. Output is "Yes" if Chef likes the sequence $A$. Output is "No" if Chef dislikes the sequence $A$.

-----Constraints-----
- $1 \le T \le 100$
- $1 \le N \le 10^3$
- $1 \le M \le 10^3$
- $1 \le A_i, B_i \le 10^9$

-----Sample Input-----
3
6
1 2 3 4 5 6
3
2 3 4
6
22 5 6 33 1 4
2
4 15
4
1 3 4 2
2
1 2

-----Sample Output-----
Yes
No
Yes

-----Explanation:-----
In sample test case $1$, the sequence $1,2,3,4,5,6$ contains the subsequence $2, 3, 4$. The subsequence is present at indices $1, 2, 3$ of the original sequence.
Hence, $1,2,3,4,5,6$ is a sequence which Chef likes it. Therefore, we output "Yes".
In sample test case $2$, the subsequence $4, 15$ is not present in sequence $22, 5, 6, 33, 1, 4$. Hence, we output "No".
In sample test case $3$, the sequence $1, 3, 4, 2$ contains the subsequence $1, 2$. The subsequence is present at indices $0, 3$. Therefore, we output "Yes".

Difficulty: interview

Starter code:

Solutions:
t=int(input())
i=0
while i<t:
 n=int(input())
 A=[]
 A=input().split()
 m=int(input())
 B=[]
 B=input().split()
 j=0
 a=-1
 while j<m:
  c=1
  if B[j] in A:
   b=A.index(B[j])
   A.remove(B[j])
   if b>=a:
    a=b
    c=1
   else:
    c=0
    break
  else:
   c=0
   break
  j+=1
 if c==1:
  print("Yes")
 else:
  print("No")
 i+=1

# cook your dish here
n=int(input())
for i in range(n):
 s=int(input())
 k=[int(j) for j in input().split()]
 ss=int(input())
 ks=[int(j) for j in input().split()]
 ki=0
 j=0
 while(ki<s and j<ss):
  if(k[ki]==ks[j]):
   j+=1
  ki+=1
 if j==ss:
  print("Yes")
 else:
  print("No")



# cook your dish here
n=int(input())
for i in range(n):
 s=int(input())
 k=[int(j) for j in input().split()]
 ss=int(input())
 ks=[int(j) for j in input().split()]
 ki=0
 j=0
 while(ki<s and j<ss):
  if(k[ki]==ks[j]):
   j+=1
  ki+=1
 if j==ss:
  print("Yes")
 else:
  print("No")



t=int(input())
for i in range (t):
 n=int(input())
 l1=[int (i) for i in input().split()]
 m=int(input())
 l2=[int (i) for i in input().split()]
 i=j=0
 while(i<n and j<m):
  if(l1[i]==l2[j]):
   j+=1
  i+=1
  
 if(j==m):
  print("Yes")
 else:
  print("No")


# cook your dish here
for i in range(int(input())):
 n=int(input())
 l_1=[int (i) for i in input().split()]
 m=int(input())
 l_2=[int (i) for i in input().split()]
 i=j=0
 while(i<n and j<m):
  if(l_1[i]==l_2[j]):
   j+=1
  i+=1
  
 if(j==m):
  print("Yes")
 else:
  print("No")

for i in range(int(input())):
 n=int(input())
 l1=[int (i) for i in input().split()]
 m=int(input())
 l2=[int (i) for i in input().split()]
 i=j=0
 while(i<n and j<m):
  if(l1[i]==l2[j]):
   j+=1
  i+=1
  
 if(j==m):
  print("Yes")
 else:
  print("No")

for _ in range(int(input())):
 a=int(input())
 lst1=list(map(int,input().split()))
 b=int(input())
 lst2=list(map(int,input().split()))
 j=i=0
 while i<b:
#         print(i)
  while j<a:
   if lst2[i]==lst1[j]:
    break
   j+=1
  if j==a:
   break
  i+=1
 if i==b and j-1<=a-1:
  print("Yes")
 else:
  print('No')

# cook your dish here
t=int(input())
for ts in range(t):
 n=int(input())
 a=list(map(int,input().split()))
 m=int(input())
 b=list(map(int,input().split()))
 k=0
 c=0
 for j in range(n):
  if (a[j] == b[k]):
   k+=1
   if(k==m):
    c=1
    print('Yes')
    break
 if(c==0):
  print('No')

# cook your dish here
t=int(input())
for _ in range(t):
 n=int(input())
 a=list(map(int,input().split()))
 m=int(input())
 b=list(map(int,input().split()))
 k=0
 c=0
 for j in range(n):
  if (a[j] == b[k]):
   k+=1
   if(k==m):
    c=1
    print('Yes')
    break
 if(c==0):
  print('No')

# cook your dish here
x=int(input())
for i in range(x):
 y=int(input())
 a=list(map(int,input().split()))
 m=int(input())
 b=list(map(int,input().split()))
 k=0
 c=0
 for j in range(y):
  if (a[j] == b[k]):
   k=k+1
   if(k==m):
    c=1
    print('Yes')
    break
 if(c==0):
  print('No')

# cook your dish here
for _ in range(int(input())):
 n1=int(input())
 l1=list(map(int,input().split()))
 n2=int(input())
 l2=list(map(int,input().split()))
 a=[]
 z=[]
 for i in range(len(l2)):
  if l2[i] in l1:
   for j in range(len(l1)):
    if l2[i] ==l1[j]:
     a.append(j)
     z.append(j)
     z.sort()
 if len(l2)==len(a) and a==z:
  print('Yes')
 else:
  print('No')


import math
for _ in range(int(input())):
 n=int(input())
 a=list(map(int,input().split()))
 m=int(input())
 b=list(map(int,input().split()))
 k=0
 for j in range(n):
  if (a[j] == b[k]):
   k+=1
   if(k==m):
    break
 print('Yes' if k==m else 'No')

# cook your dish here
t=int(input())
for _ in range(t):
 n=int(input())
 a=list(map(int,input().split()))
 m=int(input())
 b=list(map(int,input().split()))
 k=0
 c=0
 for j in range(n):
  if (a[j] == b[k]):
   k+=1
   if(k==m):
    c=1
    print('Yes')
    break
 if(c==0):
  print('No')

for _ in range(int(input())):
 n=int(input())
 a=list(map(int,input().split()))
 m=int(input())
 b=list(map(int,input().split()))
 k=0
 for j in range(n):
  if (a[j] == b[k]):
   k+=1
   if(k==m):
    break
 print('Yes' if k==m else 'No')

for _ in range(int(input())):
 n=int(input())
 a=list(map(int,input().split()))
 m=int(input())
 b=list(map(int,input().split()))
 k=0
 for j in range(n):
  if (a[j] == b[k]):
   k+=1
   if(k==m):
    break
 print('Yes' if k==m else 'No')

import math
for _ in range(int(input())):
 n=int(input())
 a=list(map(int,input().split()))
 m=int(input())
 b=list(map(int,input().split()))
 k=0
 for j in range(n):
  if (a[j] == b[k]):
   k+=1
   if(k==m):
    break
 print('Yes' if k==m else 'No')

# cook your dish here
for _ in range(int(input())):
 n = int(input())
 a = list(map(int, input().split()))
 m = int(input())
 b = list(map(int, input().split()))
 
 j = 0
 count = 0
 for i in range(len(a)):
  if a[i] == b[j]:
   count += 1
   j += 1
   if j==m:
    break
 if count == m:
  print('Yes')
 else:
  print('No')

t=int(input())
for i in range(t):
 n=int(input())
 lst=[int(i) for i in input().split()]
 m=int(input())
 lst1=[int(i) for i in input().split()]
 c=0
 for i in lst:
  if i in lst1:
   c+=1
 f=0
 if c==m:
  for i in range(m-1):
   if lst.index(lst1[i])<lst.index(lst1[i+1]):
    continue
   else:
    f=1
    break
  if f==1:
   print("No")
  else:
   print("Yes")
 else:
  print("No")
  
  
  

  
  


# cook your dish here
t=int(input())
for i in range(t):
 n=int(input())
 l=[int(i) for i in input().split()]
 m=int(input())
 l1=[int(i) for i in input().split()]
 c=0
 f=0
 for i in l1:
  if i in l:
   c=c+1
 if c==len(l1):
  for i in range(m-1):
   if l.index(l1[i])<l.index(l1[i+1]):
    continue
   else:
    f=1
    break
  if f==1:
   print("No")
  else:
   print("Yes")
 else:
  print("No")
   


t=int(input())
for i in range(t):
 a=int(input())
 fa=input().split()
 b=int(input())
 fb=input().split()
 count=0
 k=0
 search=0
 x=[]
 y=[]
 for i in range(b):
  k=fb[i]
  if(k in fa):
   x.append(fa.index(k))
   y.append(fa.index(k))
 y.sort()
 if(x==y and len(x)==b):
  print("Yes")
 else:
  print("No")
   
   
   
  
 
  
 
  
 


# cook your dish here
for i in range(int(input())):
 n=int(input())
 a=[int(i) for i in input().split()]
 b=int(input())
 c=[int(i) for i in input().split()]
 x=[]
 for j in c:
  if j in a:
   x.append(a.index(j))
 c=0
 for j in range(len(x)-1):
  if x[j]<x[j+1]:
   c=c+1
 if(c==b-1):
  print("Yes")
 else:
  print("No")


for _ in range(int(input())):
 n=int(input())
 a=list(map(int,input().split()))
 m=int(input())
 b=list(map(int,input().split()))
 x=[]
 for i in range(len(b)):
  if b[i] in a :
   x.append(a.index(b[i])) 
 c=0
 for i in range(len(x)-1):
  if x[i]<x[i+1]:
   c+=1
 if c==m-1:
  print("Yes")
 else:
  print("No")

for _ in range(int(input())):
 n=int(input())
 a=list(map(int,input().split()))
 m=int(input())
 b=list(map(int,input().split()))
 x=[]
 for i in range(len(b)):
  if b[i] in a :
   x.append(a.index(b[i])) 
 c=0
 g=sorted(x)
 if len(x)>1:
  if x==g:
   print("Yes")
  else:
   print("No")
 else:
  print("No")

#Code goes here!
t=int(input())
for i in range(t):
 n=int(input())
 a=[int(x) for x in input().split()]
 m=int(input())
 b=[int(x) for x in input().split()]
 i=j=c=0
 while i<n and j<m:
  if b[j]==a[i]:
   j+=1
   i+=1
   c+=1
  else:
   i+=1
 if c==m:
  print('Yes')
 else:
  print('No')