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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

import java.util.*;
import java.util.Map.Entry;

import javax.lang.model.util.ElementScanner6;

import java.util.*;

import java.io.*;
          

 public class FasterReader {
BufferedReader br;
StringTokenizer st;

public FasterReader() {
br = new BufferedReader(new InputStreamReader(System.in));
}
String next() {
while (st == null || !st.hasMoreElements()) {
try {
st = new StringTokenizer(br.readLine());
} catch (IOException e) {
e.printStackTrace();
}
}
return st.nextToken();
}
int nextInt() {
return Integer.parseInt(next());
}
long nextLong() {
return Long.parseLong(next());
}

double nextDouble() {
return Double.parseDouble(next());
}

String nextLine() {
String str = "";
try {
str = br.readLine();
} catch (IOException e) {
e.printStackTrace();
}
return str;

}
static long sum(int n){
    if(n==0){
        return 0;
    }
    if(n%2==0){
      return   n/=2;
    }
    else
return -n+sum(n-1);

}
static void power(int I[][],int a[][],int dem){
    //matrix multiplication
 int res[][]=new int[dem][dem];
 for(int i=0;i<dem;++i){
     for(int j=0;j<dem;++j){
         for(int k=0;k<dem;++k){
             res[i][j]+=a[i][k]*I[k][j];
         }
     }
 }
 for(int i=0;i<dem;++i){
     for(int j=0;j<dem;++j){
         I[i][j]=res[i][j];
     }
 }
  
}
public static void multiply(int a[][],int number){
   int I[][]={
       {1,0},
       {0,1},
       
   };
   for(int i=0;i<=number;++i){
        power(I,a,2);
   }
  
   for(int i=0;i<a.length;++i){
    for(int j=0;j<a[0].length;++j){
        System.out.print(I[i][j]+" ");
    }
    System.out.println();
}
   
   

}
static int avg(int a[]){
    int  sum=0;
    for(int i=0;i<a.length;++i){
        sum+=a[i];
    }
    return Math.round((float)sum/a.length);
}
static int[] seive(int max){
    int length[]=new int[max+1];
    for(int i=2;i<=max;++i){
        length[i]=i;
    }
    for(int i=2;i<=max;i+=2){
        length[i]=2;
    }
    for(int i=3;i<=Math.sqrt(max);++i){
        if(length[i]==i){
             for(int j=i*i;j<=max;j+=i){
                 if(length[j]==j){
                     length[j]=i;
                 }
             }
        }
    }
return length;

}
static ArrayList<Integer> factor(long n){
    
  int length[]=seive((int)n);
  ArrayList<Integer>A=new ArrayList<>();
  while(n!=1){
      A.add(length[(int)n]);
      n=n/length[(int)n];

  }
  
  return A;

}


public static void main(String[] args) {
FasterReader scan=new FasterReader();
  int n=scan.nextInt();
  int out=3;
  String msg="YES";
  for(int i=0;i<n;++i){
      int  temp=scan.nextInt();
      if(temp==out){
          msg="NO";
          break;
      }
     out=6-out-temp;
  }
  System.out.println(msg);
}
 }