After the bomb explodes, Mr. Farhadi, even though he moves away from the bomb, is seriously injured and falls into a coma...
Tok has taken command instead of him, and in one of the attacks, while explaining the attack plan to the soldiers, one of the soldiers says that he also has a plan to attack.
A plan for an attack is to arrange the soldiers in an $$$n \cdot n$$$ map so that there is exactly one soldier in each row and in each column. The weakness of a map is the biggest $$$k$$$ that there is a $$$k \cdot k$$$ square in the map such that there are no soldiers in it.
Tok's map is such that its weakness is the least weakness among all the maps possible (note that we don't have Tok's map). If the map that Tok's soldier suggests to him is weaker than Tok's map, Tok will throw him into the black hole!
In the input you are given the soldier's map. First, print the weakness of his map, then determine whether the soldier falls into the black hole or not. (Is there a plan whose weakness is less than the plan proposed by the soldier?)
In the first line of input you'll be given $$$n$$$.
$$$$$$1 \le n \le 5 \cdot 10^4$$$$$$
In the next line you'll receive a permutation $$$p$$$ of length $$$n$$$ which $$$p_i$$$ shows that the solider of the $$$i_{th}$$$ column is located in the $$$p_{i}{th}$$$ row.
$$$$$$1 \le p_i \le n$$$$$$
In the first line of output print the weakness of the soldier's map.
In the second line, print "YES" if the soldier falls into the black hole and "NO" otherwise.
4 1 2 3 4
2 YES
2 1 2
1 NO
Explanation of test $$$1$$$ :
You can see that the answer of soldier's plan is $$$2$$$ but the optimal answer is $$$1$$$