{"raw_statement":[{"iden":"statement","content":"You must have heard of the board game Jackaroo. The lonely geeks of the ACM community at PSUT decided to launch a solo version of that game. Basically, the aim of the game is to try and get all your N marbles to end up in their N home spots (i.e. the green holes at the center of the board as in the picture below). \n\nThe lonely geeks decided that this game must be played with an unlimited number of one single lonely card, the 7 card. Using a 7 card, you can move any marble 7 steps, or split the seven moves between two marbles (i.e. the sum of their moves must be 7). The marbles can only move clockwise starting from the outside (i.e. they can't go backwards), no two marbles can be in the same spot after playing any of the cards, and marbles can jump over each other *as long as they are not in any of the home spots*. The first hole outside the home is numbered 1 and the numbering increases counterclockwise. Given the number of marbles N, and their positions on the board, determine if its possible to get all of your marbles in the homes.\n\nThe first line of input contains a single integer N (1 ≤ N ≤ 50), the number of marbles.\n\nThe second line of input contains N distinct space-separated integers, each between 1 and 500 and represent the position of one of the marbles.\n\nPrint \"yes\" if it is possible to get all of the marbles in the homes, otherwise print \"no\".\n\n"},{"iden":"input","content":"The first line of input contains a single integer N (1 ≤ N ≤ 50), the number of marbles.The second line of input contains N distinct space-separated integers, each between 1 and 500 and represent the position of one of the marbles."},{"iden":"output","content":"Print \"yes\" if it is possible to get all of the marbles in the homes, otherwise print \"no\"."},{"iden":"examples","content":"Input31 2 8OutputyesInput21 4OutputnoInput51 2 6 7 9Outputyes"}],"translated_statement":null,"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ N \\in \\mathbb{Z} $ be the number of marbles, with $ 1 \\leq N \\leq 50 $.  \nLet $ P = \\{p_1, p_2, \\dots, p_N\\} $ be the set of distinct initial positions of the marbles, where $ p_i \\in \\mathbb{Z} $ and $ 1 \\leq p_i \\leq 500 $.  \nLet the home position be $ 0 $.  \nThe board is circular with positions numbered clockwise from $ 1 $ to $ 500 $, and movement is only allowed clockwise.  \nA move consists of distributing exactly $ 7 $ steps among any subset of marbles (each marble receives a non-negative integer number of steps, summing to $ 7 $), such that:  \n- No two marbles occupy the same position after any move.  \n- Marbles may jump over each other only if neither is at position $ 0 $.  \n- Marbles cannot move counterclockwise.  \n\n**Constraints**  \n1. $ 1 \\leq N \\leq 50 $  \n2. All $ p_i \\in [1, 500] $ and are distinct.  \n3. Movement is constrained to clockwise direction only.  \n4. Final positions of all marbles must be $ 0 $.  \n5. At no point may two marbles share a position (except possibly during jumps, but not at the end of any move).  \n\n**Objective**  \nDetermine whether there exists a finite sequence of moves, each distributing exactly $ 7 $ steps among the marbles, such that all marbles reach position $ 0 $, satisfying all movement constraints.  \nOutput \"yes\" if possible, \"no\" otherwise.","simple_statement":"You have N marbles on a circular board. Each marble can move exactly 7 steps total, either one marble moves 7 steps, or two marbles split 7 steps between them (like 3+4). Marbles move clockwise only, can jump over each other (except in home spots), and no two marbles can land on the same spot. Home spots are at position 0. Given starting positions of marbles (from 1 to 500), can you get all marbles to home (position 0) using only 7-step moves? Print \"yes\" or \"no\".","has_page_source":false}