#include <bits/stdc++.h>
using namespace std;
int ara[100 + 7];
int main() {
  int n;
  scanf("%d", &n);
  int d;
  int c = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &ara[i]);
  }
  bool ans(1);
  if (ara[1] == 3) {
    ans = 0;
  }
  if (ans) {
    int reserve = ((ara[1] == 1) ? 2 : 1);
    int won = ara[1];
    for (int i = 2; i <= n; i++) {
      if (reserve == ara[i]) {
        ans = 0;
        break;
      }
      if (won == ara[i]) {
        reserve = ((won != 1 and reserve != 1)   ? 1
                   : (won != 2 and reserve != 2) ? 2
                                                 : 3);
      } else if (won != ara[i]) {
        reserve = won;
        won = ara[i];
      }
    }
  }
  if (ans) {
    cout << "YES";
  } else {
    cout << "NO";
  }
}
