- Time limit: 1.00 s
- Memory limit: 512 MB
Maija is playing with chess pieces. She has decided to give the knights super powers! She has written down a list of positive integers. Instead of the regular L-pattern, the dimensions of the jump can now be chosen from the list. Formally, a knights position after a move from grid cell will be of the form , where .
Now Maija has started to doubt the power of the super knight. She wonders if it can capture a stationary pawn at position in an infinitely large board after a finite number of moves when the knight initially stands at .
Input
First line contains three integers and . The second line contains integers .
Output
Print "Yes" if the knight can capture the pawn and otherwise "No".
Constraints
Example 1
Input:
3 6 1 8 9 3
Output:
Yes
Example 2
Input:
1 1 2 1
Output:
No
Example 3
Input:
2 1 1 2 4
Output:
No