Description
Git is a powerful tool. When you and your partner write conflict codes, git can automatically determine whether you can merge them successfully without any code loss.
To simplify the problem, we assume that the codes are sequences of integers. If one sequence can be transformed into another sequence only by inserting numbers (i.e. you do not delete or swap the numbers), we say that the former sequence can be merged into the latter one.
Now, Whexy and his partner write some conflicting codes due to the lack of communication. Can you please help them to determine whether the code can be merged?
Input
The input contains three lines.
The first line contains two integers nn and mm, sperated by a space, indicating the length of two sequences.
The second line contains nn integers, indicating the first sequence.
The third line contains mm integers, indicating the second sequence.
We ensure that 0 < n < m < 50000<n<m<5000, and the numbers in the sequence do not exceed 100000100000.
Output
One line.
If the first sequence can be merged into the second sequence, print Yes
.
Otherwise, print No
.
Sample Input 1
5 6
1 3 5 7 9
1 3 3 5 7 9
Sample Output 1
Yes
Sample Input 2
5 6
1 3 5 7 9
1 2 4 5 7 9
Sample Output 2
No
定义数组int[] a,b;a的长度为n,b的长度为m;int i,j=0;while(i