#include <bits/stdc++.h>
using namespace std;
int n, nums[707], g[707][707];
bool calc[707][707], dp[707][707];
int gcd(int a, int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
bool solve(int l, int p) {
  if (calc[l][p]) return dp[l][p];
  if (abs(l - p) == 1) return (p == n || g[l][p] != 1);
  if (l == p) return true;
  bool ret = false;
  calc[l][p] = true;
  if (l < p) {
    for (int i = l; i < p; i++)
      if (p == n || g[i][p] != 1) {
        ret |= solve(l, i) && solve(p - 1, i);
        if (ret) break;
      }
  } else {
    for (int i = p + 1; i <= l; i++)
      if (p == n || g[i][p] != 1) {
        ret |= solve(p + 1, i) && solve(l, i);
        if (ret) break;
      }
  }
  return dp[l][p] = ret;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &nums[i]);
  sort(nums, nums + n);
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) g[i][j] = gcd(nums[i], nums[j]);
  if (solve(0, n))
    printf("YES\n");
  else
    printf("NO\n");
  return 0;
}
