Under construction

Still being built. Things may change

Manipulating the Torus Game

Time limit1sMemory limit1024 MB

Summary
Players alternately add edges to N tori without crossings; choose which tori to fill into spheres so the first player loses, or report impossible.
Level

Hard9 of 10

Topics
Game theory, Math
Solved
No attempts yet

Problem

A torus is a donut-shaped figure with one hole, as shown below.

Two players play a graph game on NN tori. At the start, the surface of torus ii has AiA_i vertices and no edges. The players take turns. On a turn, a player does the following:

  • Chooses one torus in the game and moves its vertices freely. A vertex can only move along the surface of the torus. When a vertex moves, its connected edges move with it so that no connection breaks. Two different vertices can never occupy the same position.
  • Adds one or more edges. An edge must lie on the surface of the torus and form a continuous path between its two endpoints. Any shape is allowed as long as this holds. Duplicate edges and loops are not allowed.
  • Redraws any edges on the chosen torus. The connections between vertices must not change in this step.

After the action, if the torus where the action was performed has either of the following, the player who performed the action loses immediately.

  • Two edges cross each other.
  • A vertex lies on an edge.

However, these conditions do not cause a loss in the middle of an action.

You are the second player. Before the game starts, you manipulate the tori to win. A manipulation means choosing between 0 and NN tori and filling in their holes to turn them into spheres. A sphere can be chosen during the game. At the start, a sphere has the same number of vertices as the torus had before the manipulation.

When both players use optimal strategies, determine whether you can manipulate the tori so that the first player loses. If you can, output the method. If there are several methods, any one is accepted.

Input

The first line contains the number of tori NN (1≤N≤1061\le N\le 10^6). The second line contains NN integers A1,A2,⋯ ,ANA_1, A_2, \cdots, A_N (2≤Ai≤10182\le A_i\le 10^{18}), separated by spaces.

Output

If you can manipulate the tori so that the first player loses, print Y. Otherwise, print N.

If you print Y, print the number of manipulated tori on the next line. If that number is at least one, print their indices on the following line, separated by spaces. Each index must appear only once. The order does not matter.

Hint

The sizes of the tori and spheres can be proven not to affect the outcome of the game.

Examples4

  1. Example 1

    Input
    1
    3
    
    Expected output
    N
    
  2. Example 2

    Input
    2
    2 2
    
    Expected output
    Y
    0
    
  3. Example 3

    Input
    2
    2 3
    
    Expected output
    N
    
  4. Example 4

    Input
    5
    5 7 8 9 9
    
    Expected output
    Y
    3
    1 3 4