Recently, Colin became addicted to the theory of additive combinatorics, which is about counting additive structures in sets. This theory has seen exciting developments and dramatic changes in direction in recent years, thanks to its connections with areas such as number theory, ergodic theory, and graph theory.
One fundamental problem in additive combinatorics is sumsets. For two sets of integers $$$A,B$$$, we define the sumset of $$$A$$$ and $$$B$$$ to be the set of all sums of an element from $$$A$$$ with an element from $$$B$$$. That is, $$$$$$ A+B=\{a+b:a\in A, b\in B\} $$$$$$ Now Colin gives you three sets $$$A,B,C$$$; could you determine whether $$$C$$$ is the sumset of $$$A$$$ and $$$B$$$?
The first line contains three integers $$$n_1,n_2,n_3~(1\le n_1,n_2\le 10^3,1\le n_3\le 10^6)$$$, representing the sizes of $$$A$$$, $$$B$$$, and $$$C$$$.
The second line contains $$$n_1$$$ integers $$$a_1,a_2,\cdots,a_{n_1}~(1\le a_i\le 10^9)$$$, representing the numbers in $$$A$$$.
The third line contains $$$n_2$$$ integers $$$b_1,b_2,\cdots,b_{n_2}~(1\le b_i\le 10^9)$$$, representing the numbers in $$$B$$$.
The fourth line contains $$$n_3$$$ integers $$$c_1,c_2,\cdots,c_{n_3}~(1\le c_i\le 2\times 10^9)$$$, representing the numbers in $$$C$$$.
It is guaranteed that the numbers in the same set are pairwise distinct.
If $$$C$$$ is the sumset of $$$A$$$ and $$$B$$$, output YES. Otherwise, output NO.
2 2 31 22 13 4 2
YES
2 2 21 21 22 3
NO
2 2 41 21 21 2 3 4
NO