#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t, n;
  cin >> t;
  while (t--) {
    cin >> n;
    long long temp = n / 7;
    temp *= 2;
    if (n % 7 != 0) temp++;
    temp--;
    if (temp % 4 == 0 && temp >= 4)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
}
