#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int inf = 5e8 + 100;
const int M = 1e5 + 10;
const int N = 1e9 + 10;
void debug(string s, int64_t x) { cout << s << " = " << x << '\n'; }
void solve() {
  int b;
  cin >> b;
  if (b == 1 || b == 2 || b == 4 || b == 5 || b == 8 || b == 11) {
    cout << "NO" << endl;
  } else {
    cout << "YES" << endl;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
