eolymp
bolt
Try our new interface for solving problems
Problems

Fibonacci subsequence

Fibonacci subsequence

Christopher studied sequences and permutations at school today. He really liked the Fibonacci sequence. A sequence of numbers a1, a2, ... is Fibonacci, if for any i > 2 it is true that ai = ai-1 + ai-2.

In the evening Christopher came to visit Rabbit and saw a set of cards with numbers on his table. Christopher was immediately interested in the question - is it possible to compose a Fibonacci sequence from these numbers.

Input

The first line contains the number n (1n100) of elements in the sequence. The second line contains n positive integers less than 109.

Output

Print "YES" without quotes if the numbers can be used to form a Fibonacci sequence, otherwise print "NO".

Time limit 1 second
Memory limit 128 MiB
Input example #1
3
5 8 3
Output example #1
YES

Example description: The sequence must be monotonically non-decreasing

Author С.Поромов, Н.Ведерников
Source 2011 NEERC School, Командная олимпиада, Базовая номинация, 15 October, Problem G