LearnPy Hub
← Arena
EasyRating 900

Can We Pass Every Level?

A game has levels 1 to n. Friend X can pass some levels and friend Y can pass others. Together, can they pass every level? Print YES or NO.

Input

n; then a line with p and p levels; then a line with q and q levels.

Output

YES or NO.

Sample 1

Input
4
3 1 2 3
2 2 4
Output
YES

Sample 2

Input
4
3 1 2 3
2 2 3
Output
NO
solution.py
Output appears here
Can We Pass Every Level? · Python Arena problem · LearnPy Hub