#include <bits/stdc++.h>
using namespace std;
int main() {
  int A[10000], ans = 0;
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> A[i];
    if (A[i] < 2) {
      return 0;
    }
    for (int j = 2; j < n - 1; ++j) {
      if (A[i] % j == 0) return 0;
      ans++;
    }
  }
  return 1;
}
