#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int x;
  cin >> x;
  int restr = 1;
  if (n == 1) {
    if (x == 3) {
      cout << "NO";
      return 0;
    }
    cout << "YES";
    return 0;
  }
  if (x == 3) {
    cout << "NO";
    return 0;
  } else if (x == 1) {
    restr = 2;
  }
  for (int i = 1; i < n; ++i) {
    cin >> x;
    if (restr == x) {
      cout << "NO";
      return 0;
    }
    if (x == 1) {
      if (restr == 2)
        restr = 3;
      else
        restr = 2;
    } else if (x == 2) {
      if (restr == 1)
        restr = 3;
      else
        restr = 1;
    } else if (x == 3) {
      if (restr == 1)
        restr = 2;
      else
        restr = 1;
    }
  }
  cout << "YES";
  return 0;
}
