#abc274d. [abc274_d]Robot Arms 2

[abc274_d]Robot Arms 2

Problem Statement

You are given a sequence A=(A1,A2,dots,AN)A = (A_1, A_2, \\dots, A_N) of length NN consisting of positive integers, and integers xx and yy.
Determine whether it is possible to place N+1N+1 points p1,p2,dots,pN,pN+1p_1, p_2, \\dots, p_N, p_{N+1} in the xyxy-coordinate plane to satisfy all of the following conditions. (It is allowed to place two or more points at the same coordinates.)

  • p1=(0,0)p_1 = (0, 0).
  • p2=(A1,0)p_2 = (A_1, 0).
  • pN+1=(x,y)p_{N+1} = (x, y).
  • The distance between the points pip_i and pi+1p_{i+1} is AiA_i. (1leqileqN1 \\leq i \\leq N)
  • The segments pipi+1p_i p_{i+1} and pi+1pi+2p_{i+1} p_{i+2} form a 9090 degree angle. (1leqileqN11 \\leq i \\leq N - 1)

Constraints

  • 2leqNleq1032 \\leq N \\leq 10^3
  • 1leqAileq101 \\leq A_i \\leq 10
  • x,yleq104|x|, |y| \\leq 10^4
  • All values in the input are integers.

Input

The input is given from Standard Input in the following format:

NN xx yy A1A_1 A2A_2 dots\\dots ANA_N

Output

If it is possible to place p1,p2,dots,pN,pN+1p_1, p_2, \\dots, p_N, p_{N+1} to satisfy all of the conditions in the Problem Statement, print Yes; otherwise, print No.


Sample Input 1

3 -1 1
2 1 3

Sample Output 1

Yes

The figure below shows a placement where p1=(0,0)p_1 = (0, 0), p2=(2,0)p_2 = (2, 0), p3=(2,1)p_3 = (2, 1), and p4=(1,1)p_4 = (-1, 1). All conditions in the Problem Statement are satisfied.


Sample Input 2

5 2 0
2 2 2 2 2

Sample Output 2

Yes

Letting p1=(0,0)p_1 = (0, 0), p2=(2,0)p_2 = (2, 0), p3=(2,2)p_3 = (2, 2), p4=(0,2)p_4 = (0, 2), p5=(0,0)p_5 = (0, 0), and p6=(2,0)p_6 = (2, 0) satisfies all the conditions. Note that multiple points may be placed at the same coordinates.


Sample Input 3

4 5 5
1 2 3 4

Sample Output 3

No

Sample Input 4

3 2 7
2 7 4

Sample Output 4

No

Sample Input 5

10 8 -7
6 10 4 1 5 9 8 6 5 1

Sample Output 5

Yes