#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int tc;
  cin >> tc;
  int x;
  vector<bool> pre(101, false);
  for (int i = 0; i < 35; i++) {
    for (int j = 0; j < 35; j++) {
      int a = i * 3;
      int b = j * 7;
      if (a + b > 100) {
        break;
      }
      pre[a + b] = 1;
    }
  }
  vector<string> out(2);
  out[0] = "NO";
  out[1] = "YES";
  while (tc-- > 0) {
    cin >> x;
    cout << out[pre[x]] << endl;
  }
  return 0;
}
