#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
int n;
vector<int> num;
int mem[705][705][3];
bool solve(int a, int b, int pdir) {
  if (a >= b) return true;
  if (~mem[a][b][pdir]) return mem[a][b][pdir];
  bool ret = false;
  for (int i = a; i < b && !ret; i++) {
    if (!pdir || pdir == -1 && gcd(num[a - 1], num[i]) > 1 ||
        pdir == 1 && gcd(num[b], num[i]) > 1)
      ret = ret || (solve(a, i, 1) && solve(i + 1, b, -1));
  }
  return mem[a][b][pdir] = ret;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0);
  memset(mem, -1, sizeof mem);
  cin >> n;
  num.resize(n);
  for (int i = 0; i < n; i++) cin >> num[i];
  sort(num.begin(), num.end());
  cout << (solve(0, n, 0) ? "Yes" : "No") << endl;
}
