#include <bits/stdc++.h>
using namespace std;
int main() {
  int num;
  int a1 = 1, a2 = 2, a3 = 3;
  cin >> num;
  int n[num];
  int win, lose;
  int jam = 1;
  for (int i = 1; i <= num; i++) {
    cin >> n[i];
  }
  for (int i = 1; i <= num; i++) {
    if (i == 1) {
      if (n[1] == a1) {
        win = n[i];
        lose = a2;
      } else if (n[1] == a2) {
        win = n[i];
        lose = a1;
      } else {
        jam = 0;
        break;
      }
    } else if (i == 2) {
      if (n[i] == win) {
        win = n[i];
        lose = a3;
      } else if (n[i] == a3) {
        int m = win;
        win = n[i];
        lose = m;
      } else {
        jam = 0;
        break;
      }
    } else {
      if (n[i] == win) {
        win = n[i];
        lose = 6 - win - lose;
      } else if (n[i] != win && n[i] != lose) {
        int m = win;
        win = n[i];
        lose = m;
      } else {
        jam = 0;
        break;
      }
    }
  }
  if (jam == 0) {
    cout << "NO";
  } else {
    cout << "YES";
  }
  return 0;
}
