Super sequence
Limits: 2 sec., 256 MiB
This statement was translated automatically from Ukrainian. In case of any discrepancy, the Ukrainian version is authoritative.
A sequence of numbers \(a_1\), \(a_2\), … \(a_n\) is called a super sequence if the following conditions are met:
\(0 < a_1 < a_2 < ... < a_n\).
None of the numbers is a sum of two or more other numbers.
Input
The single line contains the number \(n\), followed by \(n\) integers — the sequence of numbers.
Output
In a single line, print Yes — if it is a super sequence,
No — otherwise.
Constraints
\(1 \le n \le 50\),
\(1 \le a_i \le 1000\).
Samples
| Input (stdin) | Output (stdout) |
|---|---|
| 2 1 2 | Yes |
| Input (stdin) | Output (stdout) |
|---|---|
| 3 1 2 3 | No |
| Input (stdin) | Output (stdout) |
|---|---|
| 10 1 3 16 19 25 70 100 243 245 306 | No |
| Element Type | Created | Who | Problem | Compiler | Result | Time (sec.) | Memory (MiB) | # | Actions |
|---|