#include <bits/stdc++.h>
using namespace std;
int main() {
  int tc;
  cin >> tc;
  while (tc--) {
    long long n;
    cin >> n;
    if (n == 6 || n == 10 || n == 3 || n == 7 || n == 9)
      cout << "YES" << endl;
    else if (n >= 12)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
