#include <bits/stdc++.h>
#pragma GCC optimize "-O3"
const int N = 707;
using namespace std;
int n, a[N];
bitset<N> dp[N][N], pd[2][N], gd[N];
int gcd(int a, int b) {
  if (!b) return a;
  return gcd(b, a % b);
}
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  for (int i = 0; i < n; i++) pd[0][i][i] = pd[1][i][i] = 1;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      gd[i][j] = (gcd(a[i], a[j]) != 1);
    }
  }
  for (int d = 1; d <= n; d++) {
    for (int l = 0; l + d - 1 < n; l++) {
      int r = l + d - 1;
      for (int md = l; md <= r; md++) {
        dp[l][r][md] = pd[0][l][md] & pd[1][md][r];
        if (dp[l][r][md]) {
          if (l > 0 && gd[l - 1][md]) pd[1][l - 1][r] = 1;
          if (r < n - 1 && gd[r + 1][md]) pd[0][l][r + 1] = 1;
        }
      }
    }
  }
  bool ans = 0;
  for (int i = 0; i < n; i++) ans |= dp[0][n - 1][i];
  if (ans)
    cout << "Yes\n";
  else
    cout << "No\n";
  return 0;
}
