#include <bits/stdc++.h>
using namespace std;
int main() {
  int test;
  int x;
  cin >> test;
  while (test--) {
    cin >> x;
    if (x == 1 || x == 2 || x == 4 || x == 5 || x == 8 || x == 11)
      cout << "NO" << endl;
    else
      cout << "YES" << endl;
  }
}
