#include <bits/stdc++.h>
using namespace std;
int n;
bool b[200];
queue<int> que;
int main() {
  memset(b, true, sizeof(b));
  b[3] = b[7] = false;
  que.push(3);
  que.push(7);
  while (que.size() > 0) {
    int x = que.front();
    que.pop();
    if (x + 3 <= 100 && b[x + 3]) {
      que.push(x + 3);
      b[x + 3] = false;
    }
    if (x + 7 <= 100 && b[x + 7]) {
      que.push(x + 7);
      b[x + 7] = false;
    }
  }
  cin >> n;
  while (n--) {
    int x;
    cin >> x;
    if (!b[x])
      cout << "YES\n";
    else
      cout << "NO\n";
  }
  return 0;
}
