3.2 Subset
(RankList for this Question)
Score: 10pts
Time Limit: 1.00 sec
Given two arrays: a1[0..n-1] of size n and a2[0..m-1] of size m. Task is to check whether a2[] is a subset of a1[] or not. Both the arrays can be sorted or unsorted. There can be duplicate elements.

Constraints
1 <= n,m <= 10^5
1 <= a1[i], a2[j] <= 10^6

Input Format
First line of interger contains n and m
followed by values by a1 array and a2 array respectively

Output Format
print "yes" or "no"

Example 1
Input:
7 3
1 2 3 4 4 5 6
1 2 4

Output:
yes

Explanation:
a2[] is a subset of a1[]

Log In to solve the Question