#include <bits/stdc++.h>
const double pi = acos(-1);
const long long mod = 1e9 + 7;
const int N = 2e5 + 5, M = 505;
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  int a[n];
  int p1 = 1, p2 = 2, sp = 3;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  bool yes = 1;
  for (int i = 0; i < n; i++) {
    if (a[i] != p1 && a[i] != p2) {
      yes = 0;
      break;
    }
    if (a[i] == 1) {
      if (p1 != 1) {
        swap(p1, sp);
      } else if (p2 != 1) {
        swap(p2, sp);
      }
    } else if (a[i] == 2) {
      if (p1 != 2) {
        swap(p1, sp);
      } else if (p2 != 2) {
        swap(p2, sp);
      }
    } else if (a[i] == 3) {
      if (p1 != 3) {
        swap(p1, sp);
      } else if (p2 != 3) {
        swap(p2, sp);
      }
    }
  }
  if (yes)
    cout << "YES\n";
  else
    cout << "NO\n";
  return 0;
}
