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
3
3
3
1
1
1
1
3
3
3
3
1
2
3
1
2
2
2
3
3
2
1
3
3
1
2
3
1
1
1
2
2
2
3
1
1
1
1
1
1
3
2
2
2
2
2
2
3
1
2
2
2
2
2
3
3
2
1
1
 3
3
2
2
 3
3
2
3
 2
3
3
 3
2
2
1
 5
1
1
2
2
3
 3
1
3
1
 3
1
1
3

YES
 NO
 NO
 NO
 YES
 NO
 YES
 YES
 NO
 NO
 NO
 YES
 NO
 NO
 YES
 YES
 YES
 NO
 YES
 YES
 NO
 NO
 NO
 NO
 NO
 YES
 YES
 YES
 NO
 NO
 NO
 YES
 NO
 NO
 NO

/**
 * Created by RKS on 23-11-2017.
 */

import java.io.*;
import java.util.*;

public class ChessForThree {
    public static void main(String[] args) throws Exception {
        Scan sc = new Scan();
//        Scanner sc = new Scanner(System.in);
//        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter pw = new PrintWriter(System.out);

        int n = sc.nextInt();
        int spectating = 3;
        boolean possible = true;

        while (n-- > 0) {
            int a = sc.nextInt();

            if (spectating == 3) {
                if (a == 1)
                    spectating = 2;
                else if (a == 2)
                    spectating = 1;
                else {
                    possible = false;
                    break;
                }
            }
            else if (spectating == 2) {
                if (a == 1)
                    spectating = 3;
                else if (a == 2) {
                    possible = false;
                    break;
                }
                else
                    spectating = 1;
            }
            else {
                if (a == 1) {
                    possible = false;
                    break;
                }
                else if (a == 2) {
                    spectating = 3;
                }
                else
                    spectating = spectating = 2;
            }
        }
        pw.println(possible ? "YES": "NO");
        pw.close();
    }
}

class Scan {
        private byte[] buf = new byte[1024];    //Buffer of Bytes
        private int index;
        private InputStream in;
        private int total;

        public Scan() {
            in = System.in;
        }

        public int scan() throws IOException    //Scan method used to scan buf
        {
            if (total < 0)
                throw new InputMismatchException();
            if (index >= total) {
                index = 0;
                total = in.read(buf);
                if (total <= 0)
                    return -1;
            }
            return buf[index++];
        }

        public int nextInt() throws IOException {
            int integer = 0;
            int n = scan();
            while (isWhiteSpace(n))    //Removing starting whitespaces
                n = scan();
            int neg = 1;
            if (n == '-')                //If Negative Sign encounters
            {
                neg = -1;
                n = scan();
            }
            while (!isWhiteSpace(n)) {
                if (n >= '0' && n <= '9') {
                    integer *= 10;
                    integer += n - '0';
                    n = scan();
                } else throw new InputMismatchException();
            }
            return neg * integer;
        }

        private boolean isWhiteSpace(int n) {
            if (n == ' ' || n == '\n' || n == '\r' || n == '\t' || n == -1)
                return true;
            return false;
        }
    }


