#include <bits/stdc++.h>
using namespace std;
template <typename T>
void Read(T &x) {
  char ch;
  bool neg = 0;
  x = 0;
  while (!isdigit(ch = getchar()) && ch != '-')
    ;
  if (ch == '-') {
    neg = 1;
    ch = getchar();
  }
  do {
    x = x * 10 + ch - 48;
  } while (isdigit(ch = getchar()));
  if (neg) x = -x;
  return;
}
template <typename T>
void Write(T x) {
  char ch[32];
  int cnt = 0;
  bool neg = 0;
  if (x < 0) {
    neg = 1;
    x = -x;
  }
  do {
    ch[++cnt] = x % 10 + 48;
    x /= 10;
  } while (x);
  if (neg) putchar('-');
  for (int i = (cnt), _b = (1); i >= _b; --i) putchar(ch[i]);
}
template <typename T>
void Writeln(T x) {
  Write(x);
  putchar('\n');
}
template <typename T>
void Writesp(T x) {
  Write(x);
  putchar(' ');
}
const int MAX = 105;
int n;
int a[MAX];
void Enter() {
  Read(n);
  for (int i = (1), _b = (n); i <= _b; ++i) Read(a[i]);
}
void Solve() {
  int x = 1, y = 2, t = 3;
  for (int i = (1), _b = (n); i <= _b; ++i) {
    if (a[i] == t) {
      printf("NO");
      return;
    }
    if (a[i] == x) {
      swap(y, t);
    } else {
      swap(x, t);
    }
  }
  printf("YES");
}
int main(int argc, char const *argv[]) {
  Enter();
  Solve();
  return 0;
}
