#include <bits/stdc++.h>
using namespace std;
long long zdgys(long long n, long long m) {
  if (n < m) {
    long long temp = m;
    m = n;
    n = temp;
  }
  if (n % m == 0)
    return m;
  else
    return (m, n % m);
}
int main() {
  int n;
  cin >> n;
  int p1 = 1, p2 = 2, s = 3;
  for (int i = 0; i < n; ++i) {
    int temp;
    cin >> temp;
    if (temp == s) {
      cout << "NO";
      return 0;
    }
    if (temp == p1) {
      swap(p2, s);
    } else if (temp == p2)
      swap(p1, s);
  }
  cout << "YES";
  return 0;
}
