#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, temps, templ;
  cin >> n;
  int x[n];
  for (int i = 0; i < n; i++) {
    cin >> x[i];
  }
  for (int i = 0; i < n; i++) {
    if (x[i] % 3 == 0 || x[i] % 7 == 0) {
      cout << "YES" << endl;
      continue;
    } else if (x[i] > 11 || x[i] == 10) {
      cout << "YES" << endl;
      continue;
    }
    cout << "NO" << endl;
  }
  return 0;
}
