#CCBCHBAHAI0000102. Hai mảng có hoàn toàn giống nhau?
Hai mảng có hoàn toàn giống nhau?
Are Two Arrays Completely Equal?
Source: Phuoc Hung OJ
Version: Phuoc Hung OJ Extended
Problem
Two integer arrays and are completely equal iff and for every . Having the same values in a different order is not enough.
Input
Read , then the elements of , then , then the elements of .
Output
Print YES iff the arrays are completely equal; otherwise print NO.
Subtask
Subtask 1 (20 points): .
Subtask 2 (30 points): .
Subtask 3 (50 points): .
Example
Input
4
1 2 2 5
4
1 2 2 5
Output
YES
Explanation
The lengths and every pair of elements at equal indices match.