Master of Sequence
题号:NC237177
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld

题目描述

There is a sequence of length . You need to judge whether it has a non-decreasing or non-increasing subsequence, its length is .
subsequence of a given sequence is a sequence that can be derived from the given sequence by deleting some or no elements without changing the order of the remaining elements.

输入描述:

The first line contain one integer .
The second line contain integers .

输出描述:

If there is a subsequence that meet the conditions, print . Otherwise, print .
示例1

输入

复制
1
7 2

输出

复制
YE5
示例2

输入

复制
2
0 1 10 7 0

输出

复制
YE5