#include <bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int a = 1, b = 2, c = 3;
  vector<int> w;
  long long n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    w.push_back(x);
  }
  if (w[0] == 1) {
    a = 1;
    b = c;
    c = 2;
  } else if (w[0] == 2) {
    a = 2;
    b = c;
    c = 1;
  } else {
    cout << "NO";
    return 0;
  }
  for (int i = 1; i < n; i++) {
    if (w[i] != a && w[i] != b) {
      cout << "NO";
      return 0;
    } else {
      a = w[i];
      b = c;
      if (a == 1 && b == 2) {
        c = 3;
      } else if (a == 2 && b == 1) {
        c = 3;
      } else if (a == 3 && b == 2) {
        c = 1;
      } else if (a == 2 && b == 3) {
        c = 1;
      } else {
        c = 2;
      }
    }
  }
  cout << "YES";
  return 0;
}
