Two arrays - 2
Problem
Alice and her father, Professor Seleznev, write down the numbers on a piece of paper. Alice wrote down n
numbers, Professor Seleznev - m
numbers. Alice and the professor will be happy if they write down the same numbers (without multiplicity). Help them figure it out as they need to fly off on their next space trip.
Input
The first line contains a number
n
(1 <=
n
<= 100000) is the number of numbers written by Alice. The second line contains
n
integers whose absolute value does not exceed 10
9 – Alice's numbers. The third line contains an integer
m
- the number of numbers written by Professor Seleznev (1 <=
m
<= 100000) . The fourth line contains
m
integers whose absolute value does not exceed 10
9 – Professor Seleznev's numbers.
Output
Print
YES
if the professor and Alice wrote the same numbers, and the word
NO
otherwise.
Examples
# |
Input |
Output |
1 |
3
207
4
2 0 0 7
| YES |
Запрещенные операторы: sort
; set