#include <bits/stdc++.h>
using namespace std;
template <typename T, typename U>
inline void smin(T &a, U b) {
  if (a > b) a = b;
}
template <typename T, typename U>
inline void smax(T &a, U b) {
  if (a < b) a = b;
}
inline void gn(long long &first) {
  int sg = 1;
  char c;
  while (((c = getchar()) < '0' || c > '9') && c != '-')
    ;
  c == '-' ? (sg = -1, first = 0) : (first = c - '0');
  while ((c = getchar()) >= '0' && c <= '9') first = first * 10 + c - '0';
  first *= sg;
}
inline void gn(int &first) {
  long long t;
  gn(t);
  first = t;
}
inline void gn(unsigned long long &first) {
  long long t;
  gn(t);
  first = t;
}
inline void gn(double &first) {
  double t;
  scanf("%lf", &t);
  first = t;
}
inline void gn(long double &first) {
  double t;
  scanf("%lf", &t);
  first = t;
}
int power(int a, int b, int m, int ans = 1) {
  for (; b; b >>= 1, a = 1LL * a * a % m)
    if (b & 1) ans = 1LL * ans * a % m;
  return ans;
}
int N, a[110], f;
void calc(int u, int v, int tot) {
  if (tot > N) return;
  if (a[tot] != u && a[tot] != v) {
    f = 1;
    return;
  }
  if (a[tot] == u)
    calc(u, 6 - u - v, tot + 1);
  else if (a[tot] == v)
    calc(v, 6 - u - v, tot + 1);
  return;
}
int main() {
  gn(N);
  for (int i = 1; i <= N; i++) gn(a[i]);
  calc(1, 2, 1);
  if (f)
    puts("NO");
  else
    puts("YES");
  return 0;
}
