#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x = 1, y = 2, z = 3, a, count = 0;
  cin >> n;
  cin >> a;
  if (a == x) {
    x = x;
    swap(y, z);
    count++;
    for (int i = 0; i < n - 1; i++) {
      cin >> a;
      if (a == x) {
        x = x;
        swap(y, z);
        count++;
      } else if (a == y) {
        y = y;
        swap(x, z);
        count++;
      } else if (a == z) {
        cout << "NO\n";
        return 0;
      }
    }
  } else if (a == y) {
    y = y;
    swap(x, z);
    count++;
    for (int i = 0; i < n - 1; i++) {
      cin >> a;
      if (a == x) {
        x = x;
        swap(y, z);
        count++;
      } else if (a == y) {
        y = y;
        swap(x, z);
        count++;
      } else if (a == z) {
        cout << "NO\n";
        return 0;
      }
    }
  } else {
    cout << "NO\n";
    return 0;
  }
  if (count == n) cout << "YES\n";
  return 0;
}
