#include <bits/stdc++.h>
using namespace std;
const int A = 1e3 + 5;
long long int x, n, a[A];
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x;
    if (x % 14 > 0 && x % 14 < 7 && x > 14) {
      a[i] = 1;
    }
  }
  for (int i = 0; i < n; i++) {
    if (a[i] == 1) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
      ;
    }
  }
}
