#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(NULL);
  int n, x;
  cin >> n;
  while (n--) {
    cin >> x;
    if (x < 3 || x == 4 || x == 5 || x == 8 || x == 11)
      cout << "NO" << endl;
    else
      cout << "YES" << endl;
  }
  return 0;
}
