#include <bits/stdc++.h>
using namespace std;
void print(vector<long long> &a) {
  for (int i = 0; i < a.size(); i++) cout << a[i] << " \n"[i == a.size() - 1];
}
void print(vector<int> &a) {
  for (int i = 0; i < a.size(); i++) cout << a[i] << " \n"[i == a.size() - 1];
}
void print(int a[], int l, int r) {
  for (int i = l; i <= r; i++) cout << a[i] << " \n"[i == r];
}
void print(long long a[], int l, int r) {
  for (int i = l; i <= r; i++) cout << a[i] << " \n"[i == r];
}
long long qpow(long long x, long long y) {
  long long temp = x;
  long long ans = 1;
  while (y) {
    if (y & 1) ans = (ans * temp);
    temp = (temp * temp);
    y >>= 1;
  }
  return ans;
}
long long qpow(long long x, long long y, long long MOD) {
  long long temp = x;
  long long ans = 1;
  while (y) {
    if (y & 1) ans = (ans * temp) % MOD;
    temp = (temp * temp) % MOD;
    y >>= 1;
  }
  return ans;
}
int dp[200050];
void INIT() {
  dp[3] = 1;
  dp[7] = 1;
  for (int i = 1; i <= 100; i++)
    if (dp[i]) {
      dp[i + 3] = 1;
      dp[i + 7] = 1;
    }
}
void solve() {
  int n;
  cin >> n;
  if (dp[n]) {
    cout << "YES"
         << "\n";
  } else {
    cout << "NO"
         << "\n";
  }
}
int main() {
  INIT();
  int TT;
  cin >> TT;
  while (TT--) solve();
  return 0;
}
