#include <bits/stdc++.h>
using namespace std;
int DP[101];
int fun(int x) {
  if (x < 0)
    return -1e9;
  else if (x == 0)
    return 0;
  else {
    if (DP[x] == -1)
      return DP[x] = 1 + max(fun(x - 7), fun(x - 3));
    else
      return DP[x];
  }
}
int main() {
  memset(DP, -1, sizeof(DP));
  int t;
  int x;
  cin >> t;
  for (int tt = 0; tt < t; tt++) {
    cin >> x;
    if (fun(x) >= 0)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
}
