atcoder#ABC200D. [ABC200D] Happy Birthday! 2

[ABC200D] Happy Birthday! 2

Score : 400400 points

Problem Statement

You are given a sequence of NN positive integers: A=(A1,A2,,AN)A = (A_1, A_2, \dots, A_N). Determine whether there is a pair of sequences $B = (B_1, B_2, \dots, B_x), C = (C_1, C_2, \dots, C_y)$ satisfying all of the conditions, and print one such pair if it exists.

  • 1x,yN1 \leq x, y \leq N.
  • 1B1<B2<<BxN1 \le B_1 < B_2 < \dots < B_{x} \le N.
  • 1C1<C2<<CyN1 \le C_1 < C_2 < \dots < C_{y} \le N.
  • BB and CC are different sequences.- Here, we consider BB and CC different when xyx \neq y or there is an integer i (1imin(x,y))i\ (1 \leq i \leq \min(x, y)) such that BiCiB_i \neq C_i.
  • AB1+AB2++ABxA_{B_1} + A_{B_2} + \dots + A_{B_x} and AC1+AC2++ACyA_{C_1} + A_{C_2} + \dots + A_{C_y} are equal modulo 200200.

Constraints

  • All values in input are integers.
  • 2N2002 \le N \le 200
  • 1Ai1091 \le A_i \le 10^9

Input

Input is given from Standard Input in the following format:

NN

A1A_1 A2A_2 \dots ANA_N

Output

If there is no pair of sequences B,CB, C satisfying the conditions, print a single line containing No. Otherwise, print your choice of BB and CC in the following format:

Yes

xx B1B_1 B2B_2 \dots BxB_x

yy C1C_1 C2C_2 \dots CyC_y

The checker is case-insensitive: you can use either uppercase or lowercase letters.

5
180 186 189 191 218
Yes
1 1
2 3 4

For B=(1),C=(3,4)B=(1),C=(3,4), we have A1=180, A3+A4=380A_1 = 180,\ A_3 + A_4 = 380, which are equal modulo 200200. There are other solutions that will also be accepted, such as:

yEs
4 2 3 4 5
3 1 2 5
2
123 523
Yes
1 1
1 2
6
2013 1012 2765 2021 508 6971
No

If there is no pair of sequences satisfying the conditions, print a single line containing No.