题目描述
Problem Description
Ringo is trying to put together a problem set for the qualifying round of CODEFESTIVAL.
Ringo has $ N $ problem proposals, and the difficulty of the $ i $-th problem proposal is $ D_i $.
The qualifying round problem set requires $ M $ problems, and the difficulty of the $ i $-th problem must be exactly $ T_i $. Note that a single problem proposal cannot be used for multiple problems.
Determine whether Ringo can complete the qualifying round problem set without creating new problem proposals.
Input Format
The input is given from the standard input in the following format:
$ N $ $ D_1 $ $ D_2 $ $ ... $ $ D_N $ $ M $ $ T_1 $ $ T_2 $ $ ... $ $ T_M $
Output Format
Output YES if Ringo can complete the qualifying round problem set without creating new problem proposals, otherwise output NO.
Sample Input and Output
Sample Input #1
5
3 1 4 1 5
3
5 4 3
Sample Output #1
YES
Sample Input #2
7
100 200 500 700 1200 1600 2000
6
100 200 500 700 1600 1600
Sample Output #2
NO
Sample Input #3
1
800
5
100 100 100 100 100
Sample Output #3
NO
Sample Input #4
15
1 2 2 3 3 3 4 4 4 4 5 5 5 5 5
9
5 4 3 2 1 2 3 4 5
Sample Output #4
YES
Notes/Hints
Constraints
- $1 \leq N \leq 200,000$
- $1 \leq D_i \leq 10^9$
- $1 \leq M \leq 200,000$
- $1 \leq T_i \leq 10^9$
- All values inputted are integers.
Partial Points
- If you correctly solve the dataset where $N \leq 100$ and $M \leq 100$, you will be awarded $ 100 $ points.
Sample Explanation 2
In this input, there is a shortage of problem proposals with difficulty $ 1600 $.
输入格式
见题面 Input 部分
输出格式
见题面 Output 部分