#include <bits/stdc++.h>
using namespace std;
struct str {
  int win;
  int lose;
};
int main() {
  int n, i;
  cin >> n;
  n--;
  std::vector<str> game;
  game.reserve(n + 1);
  for (i = 0; i <= n; i++) {
    cin >> game[i].win;
  }
  if (game[0].win == 3) {
    cout << "NO";
    return 0;
  }
  if (game[0].win == 1) {
    game[0].lose = 2;
  } else {
    game[0].lose = 1;
  }
  if (game[1].win == game[0].lose) {
    cout << "NO";
    return 0;
  }
  if (game[1].win == 3) {
    game[1].lose = game[0].win;
  } else {
    game[1].lose = 3;
  }
  int k = 0;
  for (i = 2; i <= n; i++) {
    k = 0;
    if (game[i].win == game[i - 2].lose) k = 1;
    if (game[i].win == game[i - 1].win) k = 1;
    if (k == 0) {
      cout << "NO";
      return 0;
    }
    if (game[i].win == game[i - 2].lose) {
      game[i].lose = game[i - 1].win;
    }
    if (game[i].win == game[i - 1].win) {
      game[i].lose = game[i - 2].lose;
    }
  }
  cout << "YES";
  return 0;
}
