#include <bits/stdc++.h>
using namespace std;
const int maxN = 1000005;
const int mod = (int)1e9 + 7;
const int inf = (int)1e9;
int main() {
  int n;
  cin >> n;
  int x = 1, y = 2;
  for (int i = 0; i < n; ++i) {
    int w;
    cin >> w;
    if (w != x && w != y) {
      cout << "NO" << endl;
      return 0;
    }
    int nuevo;
    for (nuevo = 1; nuevo <= 3; nuevo++) {
      if (nuevo != x && nuevo != y) {
        break;
      }
    }
    x = w;
    y = nuevo;
  }
  cout << "YES" << endl;
  return 0;
}
