#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, s1, s2, s3, c, b, e = 0;
  cin >> n;
  int a;
  s1 = 1;
  s2 = 2;
  s3 = 3;
  while (n--) {
    cin >> a;
    if (a == s1) {
      s1 = a;
      c = s3;
      b = s2;
      s3 = b;
      s2 = c;
    } else if (a == s2) {
      s2 = a;
      c = s3;
      b = s1;
      s1 = c;
      s3 = b;
    } else {
      e = 1;
    }
  }
  if (e == 1) {
    cout << "NO" << endl;
    return;
  }
  cout << "YES" << endl;
  return;
}
int main() { solve(); }
