#include <bits/stdc++.h>
using namespace std;
int arr[105];
int getLost(int A, int C) {
  if (A == 1 && C == 2 || A == 2 && C == 1) return 3;
  if (A == 3 && C == 2 || A == 2 && C == 3) return 1;
  if (A == 1 && C == 3 || A == 3 && C == 1) return 2;
}
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> arr[i];
  int flag = 1;
  int A, B, C = 3;
  for (int i = 0; i < n; i++) {
    if (arr[i] == C) {
      flag = 0;
      break;
    }
    A = arr[i];
    B = getLost(A, C);
    C = B;
  }
  if (flag)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
