#include <bits/stdc++.h>
using namespace std;
int main() {
  int T;
  cin >> T;
  while (T--) {
    int n;
    cin >> n;
    if (n % 7 == 0) {
      cout << "YES" << endl;
      continue;
    }
    bool flag = 0;
    while (n > 0) {
      if (n % 3 == 0) {
        flag = 1;
        break;
      }
      n -= 7;
    }
    if (flag)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
