{"raw_statement":[{"iden":"statement","content":"Alex, Bob and Carl will soon participate in a team chess tournament. Since they are all in the same team, they have decided to practise really hard before the tournament. But it's a bit difficult for them because chess is a game for two players, not three.\n\nSo they play with each other according to following rules:\n\n*   Alex and Bob play the first game, and Carl is spectating;\n*   When the game ends, the one who lost the game becomes the spectator in the next game, and the one who was spectating plays against the winner.\n\nAlex, Bob and Carl play in such a way that there are no draws.\n\nToday they have played _n_ games, and for each of these games they remember who was the winner. They decided to make up a log of games describing who won each game. But now they doubt if the information in the log is correct, and they want to know if the situation described in the log they made up was possible (that is, no game is won by someone who is spectating if Alex, Bob and Carl play according to the rules). Help them to check it!"},{"iden":"input","content":"The first line contains one integer _n_ (1 ≤ _n_ ≤ 100) — the number of games Alex, Bob and Carl played.\n\nThen _n_ lines follow, describing the game log. _i_\\-th line contains one integer _a__i_ (1 ≤ _a__i_ ≤ 3) which is equal to 1 if Alex won _i_\\-th game, to 2 if Bob won _i_\\-th game and 3 if Carl won _i_\\-th game."},{"iden":"output","content":"Print _YES_ if the situation described in the log was possible. Otherwise print _NO_."},{"iden":"examples","content":"Input\n\n3\n1\n1\n2\n\nOutput\n\nYES\n\nInput\n\n2\n1\n2\n\nOutput\n\nNO"},{"iden":"note","content":"In the first example the possible situation is:\n\n1.  Alex wins, Carl starts playing instead of Bob;\n2.  Alex wins, Bob replaces Carl;\n3.  Bob wins.\n\nThe situation in the second example is impossible because Bob loses the first game, so he cannot win the second one."}],"translated_statement":null,"sample_group":[],"show_order":[],"formal_statement":null,"simple_statement":null,"has_page_source":false}