N,Q = map(int,input().split()) A = list(map(int,input().split())) B = list(map(int,input().split())) for i in range(Q): assert B[i] in A