#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n], b[n][2];
  for (int i = 0; i < n; i++) cin >> a[i];
  if (a[0] == 3) {
    cout << "NO";
    return 0;
  }
  b[0][0] = a[0];
  if (b[0][0] == 1)
    b[0][1] = 2;
  else
    b[0][1] = 1;
  for (int i = 1; i < n; i++) {
    b[i][0] = a[i];
    if (b[i][0] != b[i - 1][0])
      b[i][1] = b[i - 1][0];
    else if ((b[i][0] == 1 && b[i - 1][1] == 2) ||
             ((b[i][0] == 2 && b[i - 1][1] == 1)))
      b[i][1] = 3;
    else if ((b[i][0] == 1 && b[i - 1][1] == 3) ||
             ((b[i][0] == 3 && b[i - 1][1] == 1)))
      b[i][1] = 2;
    else if ((b[i][0] == 3 && b[i - 1][1] == 2) ||
             ((b[i][0] == 2 && b[i - 1][1] == 3)))
      b[i][1] = 1;
  }
  for (int i = 0; i < n; i++)
    if (b[i][0] == b[i - 1][1]) {
      cout << "NO";
      return 0;
    }
  cout << "YES";
}
