题号:NC209871
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld
题目描述
A sequence is called

-bag, if and only if it is put in order by some (maybe one) permutations of

to

. For example,

is a valid

-bag sequence.
Roundgod is not satisfied with

-bag, so she put forward part-

-bag, which is a contiguous subsequence of

-bag.
Wcy wants t
o know if the sequence of length

is a part-

-bag sequence.
输入描述:
The first line contains one integer
)
, denoting the number of test cases. Then

test cases follow.
The first line of each test case contains two integers
)
.
The second line of each test case contains

integers indicate the sequence.
It is guaranteed that

, the values of the sequence are between

and

.
输出描述:
One line of each test case, if the sequence is a part-
-bag sequence, print "YES", otherwise print "NO".