#include <iostream>
#include <bitset>
#include <algorithm>
#define lowbit(x) ((x)&(-(x)))
using namespace std;
const int N=1e6+10;
int n, m, ret, dfn[N], size[N], dcnt;
int fa[N], dep[N], t[N<<1];
bitset <N> vis;

struct edge{
	int to, nxt;
}e[N<<1]; int head[N], ecnt;

inline void add(int fr, int to)
{
	e[++ecnt]=(edge) { to, head[fr] }; head[fr]=ecnt;
}

void dfs(int x)
{
	dfn[x]=++dcnt, size[x]=1, dep[x]=dep[fa[x]]+1;
	for(int i=head[x]; i; i=e[i].nxt)
	if(e[i].to != fa[x]) fa[e[i].to]=x, dfs(e[i].to), size[x]+=size[e[i].to];
}

inline int update(int x, int k)
{
	for(int i=x; i<=n; i+=lowbit(i)) t[i]+=k;
}

inline int query(int x)
{
	int ans=0; for(int i=x; i; i-=lowbit(i)) ans+=t[i]; return ans;
}

inline void work(int x)
{
	if(dep[x]-query(dfn[x])+ret>m) return;
	for(int i=x; i; i=fa[i])
	if(!vis[i]) vis[i]=1, update(dfn[i], 1), update(dfn[i]+size[i], -1), ret++;
}

int main()
{
	ios::sync_with_stdio(false);
	cin>>n>>m; m=n-m;
	for(int i=1, x, y; i<n; i++)
	{
		cin>>x>>y;
		add(x, y);
		add(y, x);
	}
	dfs(n);
	vis[n]=1;
	for(int i=n-1; i; i--) work(i);
	for(int i=1; i<=n; i++)
	if(!vis[i]) cout<<i<<' ';
	return 0;
}


#include <iostream>
#include <bitset>
#include <algorithm>
#define lowbit(x) ((x)&(-(x)))
using namespace std;
const int N=10000010;
int n, m, ret, dfn[N], size[N], dcnt;
int fa[N], dep[N], t[N<<1];
bitset <N> vis;

struct edge{
	int to, nxt;
}e[N<<1]; int head[N], ecnt;

inline void add(int fr, int to)
{
	e[++ecnt]=(edge) { to, head[fr] }; head[fr]=ecnt;
}

void dfs(int x)
{
	dfn[x]=++dcnt, size[x]=1, dep[x]=dep[fa[x]]+1;
	for(int i=head[x]; i; i=e[i].nxt)
	if(e[i].to != fa[x]) fa[e[i].to]=x, dfs(e[i].to), size[x]+=size[e[i].to];
}

inline int update(int x, int k)
{
	for(int i=x; i<=n; i+=lowbit(i)) t[i]+=k;
}

inline int query(int x)
{
	int ans=0; for(int i=x; i; i-=lowbit(i)) ans+=t[i]; return ans;
}

inline void work(int x)
{
	if(dep[x]-query(dfn[x])+ret>m) return;
	for(int i=x; i; i=fa[i])
	if(!vis[i]) vis[i]=1, update(dfn[i], 1), update(dfn[i]+size[i], -1), ret++;
}

int main()
{
	ios::sync_with_stdio(false);
	cin>>n>>m; m=n-m;
	for(int i=1, x, y; i<n; i++)
	{
		cin>>x>>y;
		add(x, y);
		add(y, x);
	}
	dfs(n);
	vis[n]=1;
	for(int i=n-1; i; i--) work(i);
	for(int i=1; i<=n; i++)
	if(!vis[i]) cout<<i<<' ';
	return 0;
}


#include <iostream>
#include <bitset>
#include <algorithm>
#define lowbit(x) ((x)&(-(x)))
using namespace std;
const int N=1000010;
int n, m, ret, dfn[N], size[N], dcnt;
int fa[N], dep[N], t[N<<1];
bitset <N> vis;

struct edge{
	int to, nxt;
}e[N<<1]; int head[N], ecnt;

inline void add(int fr, int to)
{
	e[++ecnt]=(edge) { to, head[fr] }; head[fr]=ecnt;
}

void dfs(int x)
{
	dfn[x]=++dcnt, size[x]=1, dep[x]=dep[fa[x]]+1;
	for(int i=head[x]; i; i=e[i].nxt)
	if(e[i].to != fa[x]) fa[e[i].to]=x, dfs(e[i].to), size[x]+=size[e[i].to];
}

inline int update(int x, int k)
{
	for(int i=x; i<=n; i+=lowbit(i)) t[i]+=k;
}

inline int query(int x)
{
	int ans=0; for(int i=x; i; i-=lowbit(i)) ans+=t[i]; return ans;
}

inline void work(int x)
{
	if(dep[x]-query(dfn[x])+ret>m) return;
	for(int i=x; i; i=fa[i])
	if(!vis[i]) vis[i]=1, update(dfn[i], 1), update(dfn[i]+size[i], -1), ret++;
}

template <class T>
inline void read(T &v)
{
	char c=getchar(); v=0;
	while(c<'0' || c>'9') c=getchar();
	while(c>='0' && c<='9') v=(v<<3)+(v<<1)+(c^'0'), c=getchar();
}

int main()
{
	read(n), read(m); m=n-m;
	for(int i=1, x, y; i<n; i++)
	{
		read(x), read(y);
		add(x, y);
		add(y, x);
	}
	dfs(n);
	vis[n]=1;
	for(int i=n-1; i; i--) work(i);
	for(int i=1; i<=n; i++)
	if(!vis[i]) cout<<i<<' ';
	return 0;
}


#include <iostream>
#include <bitset>
#include <algorithm>
#define lowbit(x) ((x)&(-(x)))
using namespace std;
const int N=1000010;
int n, m, ret, dfn[N], size[N], dcnt;
int fa[N], dep[N], t[N<<1];
bitset <N> vis;

struct edge{
	int to, nxt;
}e[N<<1]; int head[N], ecnt;

inline void add(int fr, int to)
{
	e[++ecnt]=(edge) { to, head[fr] }; head[fr]=ecnt;
}

void dfs(int x)
{
	dfn[x]=++dcnt, size[x]=1, dep[x]=dep[fa[x]]+1;
	for(int i=head[x]; i; i=e[i].nxt)
	if(e[i].to != fa[x]) fa[e[i].to]=x, dfs(e[i].to), size[x]+=size[e[i].to];
}

inline int update(int x, int k)
{
	for(int i=x; i<=n; i+=lowbit(i)) t[i]+=k;
}

inline int query(int x)
{
	int ans=0; for(int i=x; i; i-=lowbit(i)) ans+=t[i]; return ans;
}

inline void work(int x)
{
	if(dep[x]-query(dfn[x])+ret>m) return;
	for(int i=x; i; i=fa[i])
	{
		if(vis[i]) break;
		vis[i]=1, update(dfn[i], 1), update(dfn[i]+size[i], -1), ret++;
	}
}

template <class T>
inline void read(T &v)
{
	char c=getchar(); v=0;
	while(c<'0' || c>'9') c=getchar();
	while(c>='0' && c<='9') v=(v<<3)+(v<<1)+(c^'0'), c=getchar();
}

int main()
{
	read(n), read(m); m=n-m;
	for(int i=1, x, y; i<n; i++)
	{
		read(x), read(y);
		add(x, y);
		add(y, x);
	}
	dfs(n);
	vis[n]=1;
	for(int i=n-1; i; i--) work(i);
	for(int i=1; i<=n; i++)
	if(!vis[i]) cout<<i<<' ';
	return 0;
}


#include<bits/stdc++.h>
#define ll long long
using namespace std;
int n,m,tot,mp[2000001],e[2000001],hd[2000001],nt[2000001],f[1000001][21];
void build(int x,int y){
	tot++;
	e[tot]=y;
	nt[tot]=hd[x];hd[x]=tot;
}
void dfs(int x,int fa){
	int i;
	for(i=hd[x];i;i=nt[i]){
		if(e[i]==fa)continue;
		f[e[i]][0]=x;
		dfs(e[i],x);
	}
}
int main(){
	int i,j,x,y,len,now;
	scanf("%d%d",&n,&m);
	for(i=1;i<n;i++){
	  scanf("%d%d",&x,&y);
	  build(x,y);build(y,x);
}
   dfs(n,0);
   for(j=1;j<=20;j++)
    for(i=1;i<=n;i++)f[i][j]=f[f[i][j-1]][j-1];
    m=n-1-m;
    mp[n]=1;mp[0]=1;
    for(i=n-1;i;i--){
    	if(mp[i])continue;
    	now=i;len=0;
    	for(j=20;j>=0;j--)if(!mp[f[now][j]])len+=1<<j,now=f[now][j];
    	len++;
    	now=i;
    	if(len<=m){
    		m-=len;
    		while(1){
    			if(mp[now])break;
    			mp[now]=1;
    			now=f[now][0];
    		}
    	}
    }
    for(i=1;i<=n;i++)if(!mp[i])printf("%d ",i);
}


#include<bits/stdc++.h>
#define ll long long
using namespace std;
int n,m,tot,mp[2000001],e[2000001],hd[2000001],nt[2000001],f[1000001][21];
void build(int x,int y){
	tot++;
	e[tot]=y;
	nt[tot]=hd[x];hd[x]=tot;
}
void dfs(int x,int fa){
	int i;
	for(i=hd[x];i;i=nt[i]){
		if(e[i]==fa)continue;
		f[e[i]][0]=x;
		dfs(e[i],x);
	}
}
int main(){
	int i,j,x,y,len,now;
	scanf("%d%d",&n,&m);
	for(i=1;i<n;i++){
	  scanf("%d%d",&x,&y);
	  build(x,y);build(y,x);
}
   dfs(n,0);
   for(j=1;j<=20;j++)
    for(i=1;i<=n;i++)f[i][j]=f[f[i][j-1]][j-1];
    m=n-1-m;
    mp[n]=1;mp[0]=1;
    for(i=n-1;i;i--){
    	if(mp[i])break;
    	now=i;len=0;
    	for(j=20;j>=0;j--)if(!mp[f[now][j]])len+=1<<j,now=f[now][j];
    	len++;
    	now=i;
    	if(len<=m){
    		m-=len;
    		while(1){
    			if(mp[now])break;
    			mp[now]=1;
    			now=f[now][0];
    		}
    	}
    }
    for(i=1;i<=n;i++)if(!mp[i])printf("%d ",i);
}


#include <bits/stdc++.h>
using namespace std;
const int MAX_N=1e6+5;
set <int> s;
int n,k;
vector <int> g[MAX_N];
int ST[MAX_N][21];
int depth[MAX_N];
bool vis[MAX_N];
int read()
{
	int x=0;
	char ch=' ';
	bool flag=false;
	while(!isdigit(ch))
	{
		if(ch=='-')flag=true;
		ch=getchar();
	}
	while(isdigit(ch))
	{
		x=(x<<3)+(x<<1)+ch-'0';
		ch=getchar();
	}
	return flag?-x:x;
}
void dfs(int v,int fa)
{
    ST[v][0]=fa;
    for(int i=0;i<g[v].size();i++)
    {
        int u=g[v][i];
        if(u==fa)continue;
        depth[u]=depth[v]+1;
        dfs(u,v);
    }
}
int main()
{
	cin>>n>>k;
	if(k==n)
	{
		for(int i=1;i<=n;i++)cout<<i<<" \n"[i==n];
		return 0;
	}
	for(int i=1;i<n;i++)
	{
		int u=read(),v=read();
		g[u].push_back(v);
		g[v].push_back(u);
	}
	dfs(n,0);
	for(int j=1;j<=20;j++)
	{
		for(int i=1;i<=n;i++)
		{
			ST[i][j]=ST[ST[i][j-1]][j-1];
		}
	}
	for(int i=1;i<n;i++)s.insert(i);
	vis[n]=true;
	vis[0]=true;
	int ret=n-k-1;
	while(ret>0)
	{
		int v=*(--s.end());
		int now=v;
		int t=1;
		for(int j=20;j>=0;j--)
		{
			if(!vis[ST[now][j]])
			{
				now=ST[now][j];
				t+=1<<j;
			}
		}
		if(t<=ret)
		{
			now=v;
			while(!vis[now])
			{
				ret--;
				vis[now]=true;
				s.erase(now);
				now=ST[now][0];
			}
		}
		else s.erase(v);
	}
	for(int i=1;i<=n;i++)if(!vis[i])cout<<i<<" ";
	cout<<endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int MAX_N=1000005;
vector <int> g[MAX_N];
bool used[MAX_N];
int n,k;
priority_queue <int,vector<int>,greater<int> > q;
int in[MAX_N];
void dfs(int v,int fa)
{
	for(int i=0;i<g[v].size();i++)
	{
		int u=g[v][i];
		if(u==fa)continue;
		in[v]++;
		dfs(u,v);
	}
}
int main()
{
	cin>>n>>k;
	for(int i=1;i<n;i++)
	{
		int a,b;
		cin>>a>>b;
		g[a].push_back(b);
		g[b].push_back(a);
	}
	dfs(n,0);
	for(int i=1;i<=n;i++)if(!in[i])q.push(i);
	vector <int> ans;
	while(k--)
	{
		int v=q.top();
		q.pop();
		for(int i=0;i<g[v].size();i++)
		{
			int u=g[v][i];
			in[u]--;
			if(!in[u])q.push(u);
		}
		ans.push_back(v);
	}
	sort(ans.begin(),ans.end());
	for(int i=0;i<ans.size();i++)cout<<ans[i]<<" \n"[i==ans.size()-1];
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int MAX_N=1e6+5;
set <int> s;
int n,k;
vector <int> g[MAX_N];
int ST[MAX_N][21];
int depth[MAX_N];
bool vis[MAX_N];
int read()
{
	int x=0;
	char ch=' ';
	bool flag=false;
	while(!isdigit(ch))
	{
		if(ch=='-')flag=true;
		ch=getchar();
	}
	while(isdigit(ch))
	{
		x=(x<<3)+(x<<1)+ch-'0';
		ch=getchar();
	}
	return flag?-x:x;
}
void dfs(int v,int fa)
{
    ST[v][0]=fa;
    for(int i=0;i<g[v].size();i++)
    {
        int u=g[v][i];
        if(u==fa)continue;
        depth[u]=depth[v]+1;
        dfs(u,v);
    }
}
int main()
{
	cin>>n>>k;
	if(k==n)
	{
		for(int i=1;i<=n;i++)cout<<i<<" \n"[i==n];
		return 0;
	}
	for(int i=1;i<n;i++)
	{
		int u,v;
		cin>>u>>v;
	//	int u=read(),v=read();
		g[u].push_back(v);
		g[v].push_back(u);
	}
	dfs(n,0);
	for(int j=1;j<=20;j++)
	{
		for(int i=1;i<=n;i++)
		{
			ST[i][j]=ST[ST[i][j-1]][j-1];
		}
	}
	for(int i=1;i<n;i++)s.insert(i);
	vis[n]=true;
	vis[0]=true;
	int ret=n-k-1;
	while(ret>0)
	{
		int v=*(--s.end());
		int now=v;
		int t=1;
		for(int j=20;j>=0;j--)
		{
			if(!vis[ST[now][j]])
			{
				now=ST[now][j];
				t+=1<<j;
			}
		}
		if(t<=ret)
		{
			now=v;
			while(!vis[now])
			{
				ret--;
				vis[now]=true;
				s.erase(now);
				now=ST[now][0];
			}
		}
		else s.erase(v);
	}
	for(int i=1;i<=n;i++)if(!vis[i])cout<<i<<" ";
	cout<<endl;
	return 0;
}


// KazamaHoang

//⣠⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⣠⣤⣶⣶
//⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⢰⣿⣿⣿⣿
//⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧⣀⣀⣾⣿⣿⣿⣿
//⣿⣿⣿⣿⣿⡏⠉⠛⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⣿
//⣿⣿⣿⣿⣿⣿⠀⠀⠀⠈⠛⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠛⠉⠁⠀⣿
//⣿⣿⣿⣿⣿⣿⣧⡀⠀⠀⠀⠀⠙⠿⠿⠿⠻⠿⠿⠟⠿⠛⠉⠀⠀⠀⠀⠀⣸⣿
//⣿⣿⣿⣿⣿⣿⣿⣷⣄⠀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿
//⣿⣿⣿⣿⣿⣿⣿⣿⣿⠏⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠠⣴⣿⣿⣿⣿
//⣿⣿⣿⣿⣿⣿⣿⣿⡟⠀⠀⢰⣹⡆⠀⠀⠀⠀⠀⠀⣭⣷⠀⠀⠀⠸⣿⣿⣿⣿
//⣿⣿⣿⣿⣿⣿⣿⣿⠃⠀⠀⠈⠉⠀⠀⠤⠄⠀⠀⠀⠉⠁⠀⠀⠀⠀⢿⣿⣿⣿
//⣿⣿⣿⣿⣿⣿⣿⣿⢾⣿⣷⠀⠀⠀⠀⡠⠤⢄⠀⠀⠀⠠⣿⣿⣷⠀⢸⣿⣿⣿
//⣿⣿⣿⣿⣿⣿⣿⣿⡀⠉⠀⠀⠀⠀⠀⢄⠀⢀⠀⠀⠀⠀⠉⠉⠁⠀⠀⣿⣿⣿
//⣿⣿⣿⣿⣿⣿⣿⣿⣧⠀⠀⠀⠀⠀⠀⠀⠈⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢹⣿⣿
//⣿⣿⣿⣿⣿⣿⣿⣿⣿⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿

#include <bits/stdc++.h>
#define fil(x) fill(x, x+n+1, 1e9)
#define reset(x) memset(x, 0,sizeof(x))
#define fr(i,a,b) for(int i = (a); i <= (b); i++)
#define FR(i,a,b) for(int i = (a); i <= (b); i++)
#define frr(i,a,b) for(int i = (a); i >= (b); i--)
#define F first
#define S second
#define ll long long
#define db double
#define maxn 50004
#define maxc 1e18
#define pb push_back
#define mp make_pair
#define pii pair<int,int>
#define Task "v"

using namespace std;

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int q;
    cin >> q;
    while (q --)
    {
        int x;
        cin >> x;
        if (x < 15)
        {
            cout << "NO\n";
            continue;
        }
        int sl = (x / 7 + 1) / 2;
        sl = sl * 21 - (sl - 1) * 7;
        sl -= x;
        if (sl <= 6 && sl >= 1) cout << "YES\n";
        else cout << "NO\n";
    }
}


// KazamaHoang

//⣠⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⣠⣤⣶⣶
//⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⢰⣿⣿⣿⣿
//⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧⣀⣀⣾⣿⣿⣿⣿
//⣿⣿⣿⣿⣿⡏⠉⠛⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⣿
//⣿⣿⣿⣿⣿⣿⠀⠀⠀⠈⠛⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠛⠉⠁⠀⣿
//⣿⣿⣿⣿⣿⣿⣧⡀⠀⠀⠀⠀⠙⠿⠿⠿⠻⠿⠿⠟⠿⠛⠉⠀⠀⠀⠀⠀⣸⣿
//⣿⣿⣿⣿⣿⣿⣿⣷⣄⠀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿
//⣿⣿⣿⣿⣿⣿⣿⣿⣿⠏⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠠⣴⣿⣿⣿⣿
//⣿⣿⣿⣿⣿⣿⣿⣿⡟⠀⠀⢰⣹⡆⠀⠀⠀⠀⠀⠀⣭⣷⠀⠀⠀⠸⣿⣿⣿⣿
//⣿⣿⣿⣿⣿⣿⣿⣿⠃⠀⠀⠈⠉⠀⠀⠤⠄⠀⠀⠀⠉⠁⠀⠀⠀⠀⢿⣿⣿⣿
//⣿⣿⣿⣿⣿⣿⣿⣿⢾⣿⣷⠀⠀⠀⠀⡠⠤⢄⠀⠀⠀⠠⣿⣿⣷⠀⢸⣿⣿⣿
//⣿⣿⣿⣿⣿⣿⣿⣿⡀⠉⠀⠀⠀⠀⠀⢄⠀⢀⠀⠀⠀⠀⠉⠉⠁⠀⠀⣿⣿⣿
//⣿⣿⣿⣿⣿⣿⣿⣿⣧⠀⠀⠀⠀⠀⠀⠀⠈⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢹⣿⣿
//⣿⣿⣿⣿⣿⣿⣿⣿⣿⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿

#include <bits/stdc++.h>
#define fil(x) fill(x, x+n+1, 1e9)
#define reset(x) memset(x, 0,sizeof(x))
#define fr(i,a,b) for(int i = (a); i <= (b); i++)
#define FR(i,a,b) for(int i = (a); i <= (b); i++)
#define frr(i,a,b) for(int i = (a); i >= (b); i--)
#define F first
#define S second
#define ll long long
#define db double
#define maxn 50004
#define maxc 1e18
#define pb push_back
#define mp make_pair
#define pii pair<int,int>
#define Task "v"

using namespace std;

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int q;
    cin >> q;
    while (q --)
    {
        ll x;
        cin >> x;
        if (x < 15)
        {
            cout << "NO\n";
            continue;
        }
        ll sl = (x / 7 + 1) / 2;
        sl = sl * 21 - (sl - 1) * 7;
        sl -= x;
        if (sl <= 6 && sl >= 1) cout << "YES\n";
        else cout << "NO\n";
    }
}


// KazamaHoang

//⣠⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⣠⣤⣶⣶
//⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⢰⣿⣿⣿⣿
//⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧⣀⣀⣾⣿⣿⣿⣿
//⣿⣿⣿⣿⣿⡏⠉⠛⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⣿
//⣿⣿⣿⣿⣿⣿⠀⠀⠀⠈⠛⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠛⠉⠁⠀⣿
//⣿⣿⣿⣿⣿⣿⣧⡀⠀⠀⠀⠀⠙⠿⠿⠿⠻⠿⠿⠟⠿⠛⠉⠀⠀⠀⠀⠀⣸⣿
//⣿⣿⣿⣿⣿⣿⣿⣷⣄⠀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿
//⣿⣿⣿⣿⣿⣿⣿⣿⣿⠏⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠠⣴⣿⣿⣿⣿
//⣿⣿⣿⣿⣿⣿⣿⣿⡟⠀⠀⢰⣹⡆⠀⠀⠀⠀⠀⠀⣭⣷⠀⠀⠀⠸⣿⣿⣿⣿
//⣿⣿⣿⣿⣿⣿⣿⣿⠃⠀⠀⠈⠉⠀⠀⠤⠄⠀⠀⠀⠉⠁⠀⠀⠀⠀⢿⣿⣿⣿
//⣿⣿⣿⣿⣿⣿⣿⣿⢾⣿⣷⠀⠀⠀⠀⡠⠤⢄⠀⠀⠀⠠⣿⣿⣷⠀⢸⣿⣿⣿
//⣿⣿⣿⣿⣿⣿⣿⣿⡀⠉⠀⠀⠀⠀⠀⢄⠀⢀⠀⠀⠀⠀⠉⠉⠁⠀⠀⣿⣿⣿
//⣿⣿⣿⣿⣿⣿⣿⣿⣧⠀⠀⠀⠀⠀⠀⠀⠈⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢹⣿⣿
//⣿⣿⣿⣿⣿⣿⣿⣿⣿⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿

#include <bits/stdc++.h>
#define fil(x) fill(x, x+n+1, 1e9)
#define reset(x) memset(x, 0,sizeof(x))
#define fr(i,a,b) for(int i = (a); i <= (b); i++)
#define FR(i,a,b) for(int i = (a); i <= (b); i++)
#define frr(i,a,b) for(int i = (a); i >= (b); i--)
#define F first
#define S second
#define ll long long
#define db double
#define maxn 50004
#define maxc 1e18
#define pb push_back
#define mp make_pair
#define pii pair<int,int>
#define Task "v"

using namespace std;

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int q;
    cin >> q;
    while (q --)
    {
        int x;
        cin >> x;
        int sl = x / 21 + 1;
        if (sl == 1)
        {
            cout << "YES\n";
            continue;
        }
        x -= (sl - 1) * 7;
        x -= (x / 21) * 21;
        if (x <= 6) cout << "YES\n";
        else cout << "NO\n";
    }
}


// KazamaHoang

//⣠⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⣠⣤⣶⣶
//⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⢰⣿⣿⣿⣿
//⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧⣀⣀⣾⣿⣿⣿⣿
//⣿⣿⣿⣿⣿⡏⠉⠛⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⣿
//⣿⣿⣿⣿⣿⣿⠀⠀⠀⠈⠛⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠛⠉⠁⠀⣿
//⣿⣿⣿⣿⣿⣿⣧⡀⠀⠀⠀⠀⠙⠿⠿⠿⠻⠿⠿⠟⠿⠛⠉⠀⠀⠀⠀⠀⣸⣿
//⣿⣿⣿⣿⣿⣿⣿⣷⣄⠀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣴⣿⣿
//⣿⣿⣿⣿⣿⣿⣿⣿⣿⠏⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠠⣴⣿⣿⣿⣿
//⣿⣿⣿⣿⣿⣿⣿⣿⡟⠀⠀⢰⣹⡆⠀⠀⠀⠀⠀⠀⣭⣷⠀⠀⠀⠸⣿⣿⣿⣿
//⣿⣿⣿⣿⣿⣿⣿⣿⠃⠀⠀⠈⠉⠀⠀⠤⠄⠀⠀⠀⠉⠁⠀⠀⠀⠀⢿⣿⣿⣿
//⣿⣿⣿⣿⣿⣿⣿⣿⢾⣿⣷⠀⠀⠀⠀⡠⠤⢄⠀⠀⠀⠠⣿⣿⣷⠀⢸⣿⣿⣿
//⣿⣿⣿⣿⣿⣿⣿⣿⡀⠉⠀⠀⠀⠀⠀⢄⠀⢀⠀⠀⠀⠀⠉⠉⠁⠀⠀⣿⣿⣿
//⣿⣿⣿⣿⣿⣿⣿⣿⣧⠀⠀⠀⠀⠀⠀⠀⠈⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢹⣿⣿
//⣿⣿⣿⣿⣿⣿⣿⣿⣿⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿

#include <bits/stdc++.h>
#define fil(x) fill(x, x+n+1, 1e9)
#define reset(x) memset(x, 0,sizeof(x))
#define fr(i,a,b) for(int i = (a); i <= (b); i++)
#define FR(i,a,b) for(int i = (a); i <= (b); i++)
#define frr(i,a,b) for(int i = (a); i >= (b); i--)
#define F first
#define S second
#define ll long long
#define db double
#define maxn 50004
#define maxc 1e18
#define pb push_back
#define mp make_pair
#define pii pair<int,int>
#define Task "v"

using namespace std;

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int q;
    cin >> q;
    while (q --)
    {
        int x;
        cin >> x;
        if (x < 15)
        {
            cout << "NO\n";
            continue;
        }
        int sl = x / 21 + 1;
        if (sl == 1)
        {
            cout << "YES\n";
            continue;
        }
        x -= (sl - 1) * 7;
        x -= (x / 21) * 21;
        if (x <= 6 && x > 0) cout << "YES\n";
        else cout << "NO\n";
    }
}


#include<bits/stdc++.h>
using namespace std;

#define GODSPEED ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define int long long int
#define pb push_back
#define mp make_pair
#define modd 1000000007LL
#define Modd 1e8
#define fill(a,b) memset(a, b, sizeof(a))

int gcd(int a, int b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);

}

// int pow2(int a,int b){
//     int ans=1;
//     while(b>0){
//         if(b&1){ans=(ans*a);}
//                 a=(a*a);
//                 b>>=1;
//         }
//     return ans;
// }

// void SieveneOfEratosthenes(int n)
// {

//     bool *prime = new bool[10000000];
//     //vector<bool> prime;
//     //for(int i=0;i<10000000;i++) prime.push_back(true);
//     memset(prime, true, sizeof(prime));
//      //cout<<1;
//     for (int p=2; p*p<=10000000; p++)
//     {

//         if (prime[p] == true)
//         {

//             for (int i=p*p; i<=10000000; i += p)
//                 prime[i] = false;
//         }
//     }
//     //out<<1;
//      int count = 0;

//     for (int p=2; p<=10000000; p++) {
//      //cout<<"1";
//        if (prime[p]){
//          cout << p << " ";
//          count++;

//          if(count==n) break;

//          }

//     }
//     delete prime[];
// }
// bool isPrime(int n)
// {
//     // Corner cases
//     if (n <= 1)
//         return false;
//     if (n <= 3)
//         return true;

//     // This is checked so that we can skip
//     // middle five numbers in below loop
//     if (n % 2 == 0 || n % 3 == 0)
//         return false;

//     for (int i = 5; i * i <= n; i = i + 6)
//         if (n % i == 0 || n % (i + 2) == 0)
//             return false;

//     return true;
// }

void solve(){
    GODSPEED
   // time_t start, end;

	float x;

	cin>>x;
	//cout<<x<<endl;
	float a,b,c,d;
	for(float y=1;y<=6;y++){

		d = x - y;
		//cout<<d<<" ";
		d/=14;

		int u = ceil(d);
		//cout<<u<<" ";

		if(u - d == 0 && d>0){
			cout<<"YES"<<endl;
			return;
		}

	}
	cout<<"NO"<<endl;

   // time(&end);
   // double time_taken = double(end - start);
   // cout << "Time taken by program is : " << fixed
   //      << time_taken << setprecision(5);
   // cout << " sec " << endl;
    return;

}

int32_t main(){
    GODSPEED

    int t;
    t=1;
    cin>>t;
    //cout<<t;

    while(t--){
        solve();
        }

   }


#include<bits/stdc++.h>
using namespace std;

#define GODSPEED ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define int long long int
#define pb push_back
#define mp make_pair
#define modd 1000000007LL
#define Modd 1e8
#define fill(a,b) memset(a, b, sizeof(a))

int gcd(int a, int b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);

}

// int pow2(int a,int b){
//     int ans=1;
//     while(b>0){
//         if(b&1){ans=(ans*a);}
//                 a=(a*a);
//                 b>>=1;
//         }
//     return ans;
// }

// void SieveneOfEratosthenes(int n)
// {

//     bool *prime = new bool[10000000];
//     //vector<bool> prime;
//     //for(int i=0;i<10000000;i++) prime.push_back(true);
//     memset(prime, true, sizeof(prime));
//      //cout<<1;
//     for (int p=2; p*p<=10000000; p++)
//     {

//         if (prime[p] == true)
//         {

//             for (int i=p*p; i<=10000000; i += p)
//                 prime[i] = false;
//         }
//     }
//     //out<<1;
//      int count = 0;

//     for (int p=2; p<=10000000; p++) {
//      //cout<<"1";
//        if (prime[p]){
//          cout << p << " ";
//          count++;

//          if(count==n) break;

//          }

//     }
//     delete prime[];
// }
// bool isPrime(int n)
// {
//     // Corner cases
//     if (n <= 1)
//         return false;
//     if (n <= 3)
//         return true;

//     // This is checked so that we can skip
//     // middle five numbers in below loop
//     if (n % 2 == 0 || n % 3 == 0)
//         return false;

//     for (int i = 5; i * i <= n; i = i + 6)
//         if (n % i == 0 || n % (i + 2) == 0)
//             return false;

//     return true;
// }

void solve(){
    GODSPEED
   // time_t start, end;

	int x;

	cin>>x;
	//cout<<x<<endl;
	double a,b,c,d;
	// for(double y=1;y<=6;y++){

	// 	d = x - y;

	// 	d/=14;
	// 	cout<<d<<endl;

	// 	double u = floor(d);

	// 	if(u == d && u>0){
	// 		cout<<"YES"<<endl;
	// 		return;
	// 	}

	// }
	d = x/14;
	if(d==0){
		cout<<"NO";
		return;
	}
	if(floor(d)!=d){
		cout<<"NO"<<endl;
		return;
	}
	int y = x%14;
	if(y>=1 && y<=6){
		cout<<"YES"<<endl;
		return;
	}

	//cout<<"NO"<<endl;

   // time(&end);
   // double time_taken = double(end - start);
   // cout << "Time taken by program is : " << fixed
   //      << time_taken << setprecision(5);
   // cout << " sec " << endl;
    return;

}

int32_t main(){
    GODSPEED

    int t;
    t=1;
    cin>>t;
    //cout<<t;

    while(t--){
        solve();
        }

   }


#include<bits/stdc++.h>
using namespace std;

#define GODSPEED ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define int long long int
#define pb push_back
#define mp make_pair
#define modd 1000000007LL
#define Modd 1e8
#define fill(a,b) memset(a, b, sizeof(a))

int gcd(int a, int b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);

}

// int pow2(int a,int b){
//     int ans=1;
//     while(b>0){
//         if(b&1){ans=(ans*a);}
//                 a=(a*a);
//                 b>>=1;
//         }
//     return ans;
// }

// void SieveneOfEratosthenes(int n)
// {

//     bool *prime = new bool[10000000];
//     //vector<bool> prime;
//     //for(int i=0;i<10000000;i++) prime.push_back(true);
//     memset(prime, true, sizeof(prime));
//      //cout<<1;
//     for (int p=2; p*p<=10000000; p++)
//     {

//         if (prime[p] == true)
//         {

//             for (int i=p*p; i<=10000000; i += p)
//                 prime[i] = false;
//         }
//     }
//     //out<<1;
//      int count = 0;

//     for (int p=2; p<=10000000; p++) {
//      //cout<<"1";
//        if (prime[p]){
//          cout << p << " ";
//          count++;

//          if(count==n) break;

//          }

//     }
//     delete prime[];
// }
// bool isPrime(int n)
// {
//     // Corner cases
//     if (n <= 1)
//         return false;
//     if (n <= 3)
//         return true;

//     // This is checked so that we can skip
//     // middle five numbers in below loop
//     if (n % 2 == 0 || n % 3 == 0)
//         return false;

//     for (int i = 5; i * i <= n; i = i + 6)
//         if (n % i == 0 || n % (i + 2) == 0)
//             return false;

//     return true;
// }

void solve(){
    GODSPEED
   // time_t start, end;

	int x;

	cin>>x;
	//cout<<x<<endl;
	double a,b,c,d;
	// for(double y=1;y<=6;y++){

	// 	d = x - y;

	// 	d/=14;
	// 	cout<<d<<endl;

	// 	double u = floor(d);

	// 	if(u == d && u>0){
	// 		cout<<"YES"<<endl;
	// 		return;
	// 	}

	// }
	d = x/14;
	if(d==0){
		cout<<"NO";
		return;
	}
	if(floor(d)!=d){
		cout<<"NO"<<endl;
	}
	int y = x%14;
	if(y>=1 && y<=6){
		cout<<"YES"<<endl;
		return;
	}

	cout<<"NO"<<endl;

   // time(&end);
   // double time_taken = double(end - start);
   // cout << "Time taken by program is : " << fixed
   //      << time_taken << setprecision(5);
   // cout << " sec " << endl;
    return;

}

int32_t main(){
    GODSPEED

    int t;
    t=1;
    cin>>t;
    //cout<<t;

    while(t--){
        solve();
        }

   }


#include<bits/stdc++.h>
using namespace std;

#define GODSPEED ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define int long long int
#define pb push_back
#define mp make_pair
#define modd 1000000007LL
#define Modd 1e8
#define fill(a,b) memset(a, b, sizeof(a))

int gcd(int a, int b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);

}

// int pow2(int a,int b){
//     int ans=1;
//     while(b>0){
//         if(b&1){ans=(ans*a);}
//                 a=(a*a);
//                 b>>=1;
//         }
//     return ans;
// }

// void SieveneOfEratosthenes(int n)
// {

//     bool *prime = new bool[10000000];
//     //vector<bool> prime;
//     //for(int i=0;i<10000000;i++) prime.push_back(true);
//     memset(prime, true, sizeof(prime));
//      //cout<<1;
//     for (int p=2; p*p<=10000000; p++)
//     {

//         if (prime[p] == true)
//         {

//             for (int i=p*p; i<=10000000; i += p)
//                 prime[i] = false;
//         }
//     }
//     //out<<1;
//      int count = 0;

//     for (int p=2; p<=10000000; p++) {
//      //cout<<"1";
//        if (prime[p]){
//          cout << p << " ";
//          count++;

//          if(count==n) break;

//          }

//     }
//     delete prime[];
// }
// bool isPrime(int n)
// {
//     // Corner cases
//     if (n <= 1)
//         return false;
//     if (n <= 3)
//         return true;

//     // This is checked so that we can skip
//     // middle five numbers in below loop
//     if (n % 2 == 0 || n % 3 == 0)
//         return false;

//     for (int i = 5; i * i <= n; i = i + 6)
//         if (n % i == 0 || n % (i + 2) == 0)
//             return false;

//     return true;
// }

void solve(){
    GODSPEED
   // time_t start, end;

	int x;

	cin>>x;
	//cout<<x<<endl;
	double a,b,c,d;
	// for(double y=1;y<=6;y++){

	// 	d = x - y;

	// 	d/=14;
	// 	cout<<d<<endl;

	// 	double u = floor(d);

	// 	if(u == d && u>0){
	// 		cout<<"YES"<<endl;
	// 		return;
	// 	}

	// }
	d = x/14;
	if(d==0){
		cout<<"NO"<<endl;
		return;
	}
	if(floor(d)!=d){
		cout<<"NO"<<endl;
		return;
	}
	int y = x%14;
	if(y>=1 && y<=6){
		cout<<"YES"<<endl;

	} else{
		cout<<"NO"<<endl;
	}

	//cout<<"NO"<<endl;

   // time(&end);
   // double time_taken = double(end - start);
   // cout << "Time taken by program is : " << fixed
   //      << time_taken << setprecision(5);
   // cout << " sec " << endl;
    return;

}

int32_t main(){
    GODSPEED

    int t;
    t=1;
    cin>>t;
    //cout<<t;

    while(t--){
        solve();
        }

   }


#include<bits/stdc++.h>
using namespace std;

#define GODSPEED ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define int long long int
#define pb push_back
#define mp make_pair
#define modd 1000000007LL
#define Modd 1e8
#define fill(a,b) memset(a, b, sizeof(a))

int gcd(int a, int b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);

}

// int pow2(int a,int b){
//     int ans=1;
//     while(b>0){
//         if(b&1){ans=(ans*a);}
//                 a=(a*a);
//                 b>>=1;
//         }
//     return ans;
// }

// void SieveneOfEratosthenes(int n)
// {

//     bool *prime = new bool[10000000];
//     //vector<bool> prime;
//     //for(int i=0;i<10000000;i++) prime.push_back(true);
//     memset(prime, true, sizeof(prime));
//      //cout<<1;
//     for (int p=2; p*p<=10000000; p++)
//     {

//         if (prime[p] == true)
//         {

//             for (int i=p*p; i<=10000000; i += p)
//                 prime[i] = false;
//         }
//     }
//     //out<<1;
//      int count = 0;

//     for (int p=2; p<=10000000; p++) {
//      //cout<<"1";
//        if (prime[p]){
//          cout << p << " ";
//          count++;

//          if(count==n) break;

//          }

//     }
//     delete prime[];
// }
// bool isPrime(int n)
// {
//     // Corner cases
//     if (n <= 1)
//         return false;
//     if (n <= 3)
//         return true;

//     // This is checked so that we can skip
//     // middle five numbers in below loop
//     if (n % 2 == 0 || n % 3 == 0)
//         return false;

//     for (int i = 5; i * i <= n; i = i + 6)
//         if (n % i == 0 || n % (i + 2) == 0)
//             return false;

//     return true;
// }

void solve(){
    GODSPEED
   // time_t start, end;

	double x;

	cin>>x;
	//cout<<x<<endl;
	double a,b,c,d;
	for(double y=1;y<=6;y++){

		d = x - y;
		//cout<<d<<" ";
		d/=14;

		int u = floor(d);
		//cout<<u<<" ";

		if(u - d == 0 && u>0){
			cout<<"YES"<<endl;
			return;
		}

	}
	cout<<"NO"<<endl;

   // time(&end);
   // double time_taken = double(end - start);
   // cout << "Time taken by program is : " << fixed
   //      << time_taken << setprecision(5);
   // cout << " sec " << endl;
    return;

}

int32_t main(){
    GODSPEED

    int t;
    t=1;
    cin>>t;
    //cout<<t;

    while(t--){
        solve();
        }

   }


#include<bits/stdc++.h>
using namespace std;

#define GODSPEED ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define int long long int
#define pb push_back
#define mp make_pair
#define modd 1000000007LL
#define Modd 1e8
#define fill(a,b) memset(a, b, sizeof(a))

int gcd(int a, int b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);

}

// int pow2(int a,int b){
//     int ans=1;
//     while(b>0){
//         if(b&1){ans=(ans*a);}
//                 a=(a*a);
//                 b>>=1;
//         }
//     return ans;
// }

// void SieveneOfEratosthenes(int n)
// {

//     bool *prime = new bool[10000000];
//     //vector<bool> prime;
//     //for(int i=0;i<10000000;i++) prime.push_back(true);
//     memset(prime, true, sizeof(prime));
//      //cout<<1;
//     for (int p=2; p*p<=10000000; p++)
//     {

//         if (prime[p] == true)
//         {

//             for (int i=p*p; i<=10000000; i += p)
//                 prime[i] = false;
//         }
//     }
//     //out<<1;
//      int count = 0;

//     for (int p=2; p<=10000000; p++) {
//      //cout<<"1";
//        if (prime[p]){
//          cout << p << " ";
//          count++;

//          if(count==n) break;

//          }

//     }
//     delete prime[];
// }
// bool isPrime(int n)
// {
//     // Corner cases
//     if (n <= 1)
//         return false;
//     if (n <= 3)
//         return true;

//     // This is checked so that we can skip
//     // middle five numbers in below loop
//     if (n % 2 == 0 || n % 3 == 0)
//         return false;

//     for (int i = 5; i * i <= n; i = i + 6)
//         if (n % i == 0 || n % (i + 2) == 0)
//             return false;

//     return true;
// }

void solve(){
    GODSPEED
   // time_t start, end;

	double x;

	cin>>x;
	//cout<<x<<endl;
	double a,b,c,d;
	for(double y=1;y<=6;y++){

		d = x - y;
		//cout<<d<<" ";
		d/=14;

		double u = floor(d);
		//cout<<u<<" ";

		if(u == d && u>0){
			cout<<"YES"<<endl;
			return;
		}

	}
	cout<<"NO"<<endl;

   // time(&end);
   // double time_taken = double(end - start);
   // cout << "Time taken by program is : " << fixed
   //      << time_taken << setprecision(5);
   // cout << " sec " << endl;
    return;

}

int32_t main(){
    GODSPEED

    int t;
    t=1;
    cin>>t;
    //cout<<t;

    while(t--){
        solve();
        }

   }


#include<bits/stdc++.h>
using namespace std;

#define GODSPEED ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define int long long int
#define pb push_back
#define mp make_pair
#define modd 1000000007LL
#define Modd 1e8
#define fill(a,b) memset(a, b, sizeof(a))

int gcd(int a, int b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);

}

// int pow2(int a,int b){
//     int ans=1;
//     while(b>0){
//         if(b&1){ans=(ans*a);}
//                 a=(a*a);
//                 b>>=1;
//         }
//     return ans;
// }

// void SieveneOfEratosthenes(int n)
// {

//     bool *prime = new bool[10000000];
//     //vector<bool> prime;
//     //for(int i=0;i<10000000;i++) prime.push_back(true);
//     memset(prime, true, sizeof(prime));
//      //cout<<1;
//     for (int p=2; p*p<=10000000; p++)
//     {

//         if (prime[p] == true)
//         {

//             for (int i=p*p; i<=10000000; i += p)
//                 prime[i] = false;
//         }
//     }
//     //out<<1;
//      int count = 0;

//     for (int p=2; p<=10000000; p++) {
//      //cout<<"1";
//        if (prime[p]){
//          cout << p << " ";
//          count++;

//          if(count==n) break;

//          }

//     }
//     delete prime[];
// }
// bool isPrime(int n)
// {
//     // Corner cases
//     if (n <= 1)
//         return false;
//     if (n <= 3)
//         return true;

//     // This is checked so that we can skip
//     // middle five numbers in below loop
//     if (n % 2 == 0 || n % 3 == 0)
//         return false;

//     for (int i = 5; i * i <= n; i = i + 6)
//         if (n % i == 0 || n % (i + 2) == 0)
//             return false;

//     return true;
// }

void solve(){
    GODSPEED
   // time_t start, end;

	int x;

	cin>>x;
	//cout<<x<<endl;
	double a,b,c,d;
	// for(double y=1;y<=6;y++){

	// 	d = x - y;

	// 	d/=14;
	// 	cout<<d<<endl;

	// 	double u = floor(d);

	// 	if(u == d && u>0){
	// 		cout<<"YES"<<endl;
	// 		return;
	// 	}

	// }
	d = x/14;
	if(d==0){
		cout<<"NO";
		return;
	}
	if(floor(d)!=d){
		cout<<"NO"<<endl;
		return;
	}
	int y = x%14;
	if(y>=1 && y<=6){
		cout<<"YES"<<endl;

	} else{
		cout<<"NO"<<endl;
	}

	//cout<<"NO"<<endl;

   // time(&end);
   // double time_taken = double(end - start);
   // cout << "Time taken by program is : " << fixed
   //      << time_taken << setprecision(5);
   // cout << " sec " << endl;
    return;

}

int32_t main(){
    GODSPEED

    int t;
    t=1;
    cin>>t;
    //cout<<t;

    while(t--){
        solve();
        }

   }


#include<bits/stdc++.h>
using namespace std;

#define GODSPEED ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define int long long int
#define pb push_back
#define mp make_pair
#define modd 1000000007LL
#define Modd 1e8
#define fill(a,b) memset(a, b, sizeof(a))

int gcd(int a, int b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);

}

// int pow2(int a,int b){
//     int ans=1;
//     while(b>0){
//         if(b&1){ans=(ans*a);}
//                 a=(a*a);
//                 b>>=1;
//         }
//     return ans;
// }

// void SieveneOfEratosthenes(int n)
// {

//     bool *prime = new bool[10000000];
//     //vector<bool> prime;
//     //for(int i=0;i<10000000;i++) prime.push_back(true);
//     memset(prime, true, sizeof(prime));
//      //cout<<1;
//     for (int p=2; p*p<=10000000; p++)
//     {

//         if (prime[p] == true)
//         {

//             for (int i=p*p; i<=10000000; i += p)
//                 prime[i] = false;
//         }
//     }
//     //out<<1;
//      int count = 0;

//     for (int p=2; p<=10000000; p++) {
//      //cout<<"1";
//        if (prime[p]){
//          cout << p << " ";
//          count++;

//          if(count==n) break;

//          }

//     }
//     delete prime[];
// }
// bool isPrime(int n)
// {
//     // Corner cases
//     if (n <= 1)
//         return false;
//     if (n <= 3)
//         return true;

//     // This is checked so that we can skip
//     // middle five numbers in below loop
//     if (n % 2 == 0 || n % 3 == 0)
//         return false;

//     for (int i = 5; i * i <= n; i = i + 6)
//         if (n % i == 0 || n % (i + 2) == 0)
//             return false;

//     return true;
// }

void solve(){
    GODSPEED
   // time_t start, end;

	int x;

	cin>>x;
	//cout<<x<<endl;
	double a,b,c,d;
	for(double y=1;y<=6;y++){

		d = x - y;
		//cout<<d<<" ";
		d/=14;

		double u = floor(d);
		//cout<<u<<" ";

		if(u == d && u>0){
			cout<<"YES"<<endl;
			return;
		}

	}
	cout<<"NO"<<endl;

   // time(&end);
   // double time_taken = double(end - start);
   // cout << "Time taken by program is : " << fixed
   //      << time_taken << setprecision(5);
   // cout << " sec " << endl;
    return;

}

int32_t main(){
    GODSPEED

    int t;
    t=1;
    cin>>t;
    //cout<<t;

    while(t--){
        solve();
        }

   }


#include<bits/stdc++.h>
using namespace std;

#define GODSPEED ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define int long long int
#define pb push_back
#define mp make_pair
#define modd 1000000007LL
#define Modd 1e8
#define fill(a,b) memset(a, b, sizeof(a))

int gcd(int a, int b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);

}

// int pow2(int a,int b){
//     int ans=1;
//     while(b>0){
//         if(b&1){ans=(ans*a);}
//                 a=(a*a);
//                 b>>=1;
//         }
//     return ans;
// }

// void SieveneOfEratosthenes(int n)
// {

//     bool *prime = new bool[10000000];
//     //vector<bool> prime;
//     //for(int i=0;i<10000000;i++) prime.push_back(true);
//     memset(prime, true, sizeof(prime));
//      //cout<<1;
//     for (int p=2; p*p<=10000000; p++)
//     {

//         if (prime[p] == true)
//         {

//             for (int i=p*p; i<=10000000; i += p)
//                 prime[i] = false;
//         }
//     }
//     //out<<1;
//      int count = 0;

//     for (int p=2; p<=10000000; p++) {
//      //cout<<"1";
//        if (prime[p]){
//          cout << p << " ";
//          count++;

//          if(count==n) break;

//          }

//     }
//     delete prime[];
// }
// bool isPrime(int n)
// {
//     // Corner cases
//     if (n <= 1)
//         return false;
//     if (n <= 3)
//         return true;

//     // This is checked so that we can skip
//     // middle five numbers in below loop
//     if (n % 2 == 0 || n % 3 == 0)
//         return false;

//     for (int i = 5; i * i <= n; i = i + 6)
//         if (n % i == 0 || n % (i + 2) == 0)
//             return false;

//     return true;
// }

void solve(){
    GODSPEED
   // time_t start, end;

	int x;

	cin>>x;
	//cout<<x<<endl;
	double a,b,c,d;
	// for(double y=1;y<=6;y++){

	// 	d = x - y;

	// 	d/=14;
	// 	cout<<d<<endl;

	// 	double u = floor(d);

	// 	if(u == d && u>0){
	// 		cout<<"YES"<<endl;
	// 		return;
	// 	}

	// }
	d = x/14;
	if(d==0){
		cout<<"NO";
		return;
	}
	int y = x%14;
	if(y>=1 && y<=6){
		cout<<"YES"<<endl;
		return;
	}

	cout<<"NO"<<endl;

   // time(&end);
   // double time_taken = double(end - start);
   // cout << "Time taken by program is : " << fixed
   //      << time_taken << setprecision(5);
   // cout << " sec " << endl;
    return;

}

int32_t main(){
    GODSPEED

    int t;
    t=1;
    cin>>t;
    //cout<<t;

    while(t--){
        solve();
        }

   }


#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
#define pb push_back
#define rsz resize
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
using pi = pair<int,int>;
#define f first
#define s second
#define mp make_pair
#define DEBUG(x) cout << '>' << #x << ':' << x << endl;
void setIO(string name = "1266A") {
    ios_base::sync_with_stdio(0); cin.tie(0);
    freopen((name+".in").c_str(), "r", stdin);
    freopen((name+".out").c_str(), "w", stdout);
}

int main() {
    //setIO();
    int t; cin >> t;
    while (t--) {
        ll n; cin >> n;
        if (n % 14 >= 1 && n % 14 <= 7) {
            cout << "YES" << "\n";
        } else {
            cout << "NO" << "\n";
        }
    }
}


#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
#define pb push_back
#define rsz resize
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
using pi = pair<int,int>;
#define f first
#define s second
#define mp make_pair
#define DEBUG(x) cout << '>' << #x << ':' << x << endl;
void setIO(string name = "1266A") {
    ios_base::sync_with_stdio(0); cin.tie(0);
    freopen((name+".in").c_str(), "r", stdin);
    freopen((name+".out").c_str(), "w", stdout);
}

int main() {
    //setIO();
    int t; cin >> t;
    while (t--) {
        ll n; cin >> n;
        if (n % 14 <= 7) {
            cout << "YES" << "\n";
        } else {
            cout << "NO" << "\n";
        }
    }
}


#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
#define pb push_back
#define rsz resize
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
using pi = pair<int,int>;
#define f first
#define s second
#define mp make_pair
#define DEBUG(x) cout << '>' << #x << ':' << x << endl;
void setIO(string name = "1266A") {
    ios_base::sync_with_stdio(0); cin.tie(0);
    freopen((name+".in").c_str(), "r", stdin);
    freopen((name+".out").c_str(), "w", stdout);
}

int main() {
    //setIO();
    int t; cin >> t;
    while (t--) {
        ll n; cin >> n;
        if (n % 14 >= 1 && n % 14 <= 8) {
            cout << "YES" << "\n";
        } else {
            cout << "NO" << "\n";
        }
    }
}


#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
#define pb push_back
#define rsz resize
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
using pi = pair<int,int>;
#define f first
#define s second
#define mp make_pair
#define DEBUG(x) cout << '>' << #x << ':' << x << endl;
void setIO(string name = "1266A") {
    ios_base::sync_with_stdio(0); cin.tie(0);
    freopen((name+".in").c_str(), "r", stdin);
    freopen((name+".out").c_str(), "w", stdout);
}

int main() {
    //setIO();
    int t; cin >> t;
    while (t--) {
        ll n; cin >> n;
        if (n % 14 <= 6 && n % 14 > 0) {
            cout << "YES" << "\n";
        } else {
            cout << "NO" << "\n";
        }
    }
}


#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
#define pb push_back
#define rsz resize
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
using pi = pair<int,int>;
#define f first
#define s second
#define mp make_pair
#define DEBUG(x) cout << '>' << #x << ':' << x << endl;
void setIO(string name = "1266A") {
    ios_base::sync_with_stdio(0); cin.tie(0);
    freopen((name+".in").c_str(), "r", stdin);
    freopen((name+".out").c_str(), "w", stdout);
}

int main() {
    //setIO();
    int t; cin >> t;
    while (t--) {
        ll n; cin >> n;
        if (n % 14 <= 6 && n % 14 > 0 && n > 12) {
            cout << "YES" << "\n";
        } else {
            cout << "NO" << "\n";
        }
    }
}


#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
#define pb push_back
#define rsz resize
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
using pi = pair<int,int>;
#define f first
#define s second
#define mp make_pair
#define DEBUG(x) cout << '>' << #x << ':' << x << endl;
void setIO(string name = "1266A") {
    ios_base::sync_with_stdio(0); cin.tie(0);
    freopen((name+".in").c_str(), "r", stdin);
    freopen((name+".out").c_str(), "w", stdout);
}

int main() {
    //setIO();
    int t; cin >> t;
    while (t--) {
        ll n; cin >> n;
        if (n % 14 <= 8) {
            cout << "YES" << "\n";
        } else {
            cout << "NO" << "\n";
        }
    }
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin>>n;
    int m;
    for(int i=0;i<n;i++)
    {
        cin>>m;
        if(m%14!=0&&m%14<7&&m>14)cout<<"YES\n";break;
        cout<<"NO\n";
    }
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin>>n;
    int m;
    for(int i=0;i<n;i++)
    {
        cin>>m;
        if(m%14!=0&&m%14<7&&m>14){cout<<"YES\n";continue;}
        cout<<"NO\n";
    }
}


#include <bits/stdc++.h>
using namespace std;
int main(){int t,a;cin>>t;while(t--){cin>>a;cout<<((a>14&&a%14<7)?"YES":"NO")<<endl;}}


#include <bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin>>n;
    long long k;
    for(int i=0;i<n;i++)
    {
        cin>>k;
        while(k%7!=0)k--;
        k/=7;
        cout<<((k%2==0)?"YES":"NO")<<endl;
    }
}


#include <bits/stdc++.h>
using namespace std;
int main(){int t,a;cin>>t;while(t--){cin>>a;cout<<((a>14&&a%14<7&&a%14>0)?"YES":"NO")<<endl;}}


#include <bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin>>n;
    int m;
    for(int i=0;i<n;i++)
    {
        cin>>m;
        if(m%14!=0&&m%14<7&&m>14)cout<<"YES\n";continue;
        cout<<"NO\n";
    }
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin>>n;
    long long k;
    for(int i=0;i<n;i++)
    {
        cin>>k;
        if(k%14 == 0)cout<<"NO"<<endl;
        else if((k%14)<7)
        {
            cout<<"YES"<<endl;
        }
        else cout<<"NO"<<endl;
    }
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin>>n;
    long long k;
    for(int i=0;i<n;i++)
    {
        cin>>k;
        k/=7;
        cout<<((k%2==0)?"YES":"NO")<<endl;
    }
}


#include <bits/stdc++.h>
using namespace std;
int main(){long long t,a;cin>>t;while(t--){cin>>a;cout<<((a>14&&a%14<7&&a%14>0)?"YES":"NO")<<endl;}}


/*
このコード、と～おれ!
Be accepted!
∧＿∧
（｡･ω･｡)つ━☆・*。
⊂　　 ノ 　　　・゜+.
　しーＪ　　　°。+ *´¨)
 　　　　　　　　　.· ´¸.·*´¨) ¸.·*¨)
		  　　　　　　　　　　(¸.·´ (¸.·'* ☆
					*/

#include <stdio.h>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstring>
#include <vector>
#include <numeric>
#include <iostream>
#include <random>
#include <map>
#include <unordered_map>
#include <queue>
#include <regex>

#pragma GCC optimize("Ofast")
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define rep1(i, n) for(int i = 1; i <= (n); ++i)
#define rep2(i, n) for(int i = 2; i < (n); ++i)
#define repr(i, n) for(int i = n; i >= 0; --i)
#define reprm(i, n) for(int i = n - 1; i >= 0; --i)
#define printynl(a) printf(a ? "yes\n" : "no\n")
#define printyn(a) printf(a ? "Yes\n" : "No\n")
#define printYN(a) printf(a ? "YES\n" : "NO\n")
#define printin(a) printf(a ? "possible\n" : "inposible\n")
#define printdb(a) printf("%.50lf\n", a)//少数出力
#define printdbd(a) printf("%.16lf\n", a)//少数出力(桁少なめ)
#define prints(s) printf("%s\n", s.c_str())//string出力
#define all(x) (x).begin(), (x).end()
#define allsum(a, b, c) ((a + b) * c / 2)//等差数列の和、初項,末項,項数
#define pb push_back
#define priq priority_queue
#define rpriq priq<int, vector<int>, greater<int>>
#define deg_to_rad(deg) (((deg)/360.0)*2.0*PI)
#define rad_to_deg(rad) (((rad)/2.0/PI)*360.0)
#define Please return
#define AC 0

using ll = long long;

constexpr int INF = 1073741823;
constexpr int MINF = -1073741823;
constexpr ll LINF = ll(4661686018427387903);
constexpr ll MOD = 1000000007;
const double PI = acos(-1);

using namespace std;

void scans(string& str) {
	char c;
	str = "";
	scanf("%c", &c);
	if (c == '\n')scanf("%c", &c);//最初の改行対策
	while (c != '\n' && c != -1) {
		str += c;
		scanf("%c", &c);
	}
}

void scanc(char& str) {
	char c;
	scanf("%c", &c);
	if (c == -1)return;
	while (c == '\n') {
		scanf("%c", &c);
	}
	str = c;
}

double acot(double x) {
	return PI / 2 - atan(x);
}

/*-----------------------------------------ここからコード-----------------------------------------*/

int main() {

	int n;
	scanf("%d", &n);
	rep(query, n) {
		int x;
		scanf("%d", &x);
		printYN(x - 28 <= 6);
	}

	Please AC;
}


/*
このコード、と～おれ!
Be accepted!
∧＿∧
（｡･ω･｡)つ━☆・*。
⊂　　 ノ 　　　・゜+.
　しーＪ　　　°。+ *´¨)
 　　　　　　　　　.· ´¸.·*´¨) ¸.·*¨)
		  　　　　　　　　　　(¸.·´ (¸.·'* ☆
					*/

#include <stdio.h>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstring>
#include <vector>
#include <numeric>
#include <iostream>
#include <random>
#include <map>
#include <unordered_map>
#include <queue>
#include <regex>

#pragma GCC optimize("Ofast")
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define rep1(i, n) for(int i = 1; i <= (n); ++i)
#define rep2(i, n) for(int i = 2; i < (n); ++i)
#define repr(i, n) for(int i = n; i >= 0; --i)
#define reprm(i, n) for(int i = n - 1; i >= 0; --i)
#define printynl(a) printf(a ? "yes\n" : "no\n")
#define printyn(a) printf(a ? "Yes\n" : "No\n")
#define printYN(a) printf(a ? "YES\n" : "NO\n")
#define printin(a) printf(a ? "possible\n" : "inposible\n")
#define printdb(a) printf("%.50lf\n", a)//少数出力
#define printdbd(a) printf("%.16lf\n", a)//少数出力(桁少なめ)
#define prints(s) printf("%s\n", s.c_str())//string出力
#define all(x) (x).begin(), (x).end()
#define allsum(a, b, c) ((a + b) * c / 2)//等差数列の和、初項,末項,項数
#define pb push_back
#define priq priority_queue
#define rpriq priq<int, vector<int>, greater<int>>
#define deg_to_rad(deg) (((deg)/360.0)*2.0*PI)
#define rad_to_deg(rad) (((rad)/2.0/PI)*360.0)
#define Please return
#define AC 0

using ll = long long;

constexpr int INF = 1073741823;
constexpr int MINF = -1073741823;
constexpr ll LINF = ll(4661686018427387903);
constexpr ll MOD = 1000000007;
const double PI = acos(-1);

using namespace std;

void scans(string& str) {
	char c;
	str = "";
	scanf("%c", &c);
	if (c == '\n')scanf("%c", &c);//最初の改行対策
	while (c != '\n' && c != -1) {
		str += c;
		scanf("%c", &c);
	}
}

void scanc(char& str) {
	char c;
	scanf("%c", &c);
	if (c == -1)return;
	while (c == '\n') {
		scanf("%c", &c);
	}
	str = c;
}

double acot(double x) {
	return PI / 2 - atan(x);
}

/*-----------------------------------------ここからコード-----------------------------------------*/

int main() {

	int n;
	scanf("%d", &n);
	rep(query, n) {
		ll x;
		scanf("%lld", &x);
		printYN(x % 7 <= 6);
	}

	Please AC;
}


/*
このコード、と～おれ!
Be accepted!
∧＿∧
（｡･ω･｡)つ━☆・*。
⊂　　 ノ 　　　・゜+.
　しーＪ　　　°。+ *´¨)
 　　　　　　　　　.· ´¸.·*´¨) ¸.·*¨)
		  　　　　　　　　　　(¸.·´ (¸.·'* ☆
					*/

#include <stdio.h>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstring>
#include <vector>
#include <numeric>
#include <iostream>
#include <random>
#include <map>
#include <unordered_map>
#include <queue>
#include <regex>

#pragma GCC optimize("Ofast")
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define rep1(i, n) for(int i = 1; i <= (n); ++i)
#define rep2(i, n) for(int i = 2; i < (n); ++i)
#define repr(i, n) for(int i = n; i >= 0; --i)
#define reprm(i, n) for(int i = n - 1; i >= 0; --i)
#define printynl(a) printf(a ? "yes\n" : "no\n")
#define printyn(a) printf(a ? "Yes\n" : "No\n")
#define printYN(a) printf(a ? "YES\n" : "NO\n")
#define printin(a) printf(a ? "possible\n" : "inposible\n")
#define printdb(a) printf("%.50lf\n", a)//少数出力
#define printdbd(a) printf("%.16lf\n", a)//少数出力(桁少なめ)
#define prints(s) printf("%s\n", s.c_str())//string出力
#define all(x) (x).begin(), (x).end()
#define allsum(a, b, c) ((a + b) * c / 2)//等差数列の和、初項,末項,項数
#define pb push_back
#define priq priority_queue
#define rpriq priq<int, vector<int>, greater<int>>
#define deg_to_rad(deg) (((deg)/360.0)*2.0*PI)
#define rad_to_deg(rad) (((rad)/2.0/PI)*360.0)
#define Please return
#define AC 0

using ll = long long;

constexpr int INF = 1073741823;
constexpr int MINF = -1073741823;
constexpr ll LINF = ll(4661686018427387903);
constexpr ll MOD = 1000000007;
const double PI = acos(-1);

using namespace std;

void scans(string& str) {
	char c;
	str = "";
	scanf("%c", &c);
	if (c == '\n')scanf("%c", &c);//最初の改行対策
	while (c != '\n' && c != -1) {
		str += c;
		scanf("%c", &c);
	}
}

void scanc(char& str) {
	char c;
	scanf("%c", &c);
	if (c == -1)return;
	while (c == '\n') {
		scanf("%c", &c);
	}
	str = c;
}

double acot(double x) {
	return PI / 2 - atan(x);
}

/*-----------------------------------------ここからコード-----------------------------------------*/

int main() {

	int n;
	scanf("%d", &n);
	rep(query, n) {
		ll x;
		scanf("%lld", &x);
		while (x >= 0) {
			x -= 14;
			if (1 <= x && x <= 6) {
				printYN(true);
				break;
			}
		}
		if (!(1 <= x && x <= 6))printYN(false);
	}

	Please AC;
}


/*
このコード、と～おれ!
Be accepted!
∧＿∧
（｡･ω･｡)つ━☆・*。
⊂　　 ノ 　　　・゜+.
　しーＪ　　　°。+ *´¨)
 　　　　　　　　　.· ´¸.·*´¨) ¸.·*¨)
		  　　　　　　　　　　(¸.·´ (¸.·'* ☆
					*/

#include <stdio.h>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstring>
#include <vector>
#include <numeric>
#include <iostream>
#include <random>
#include <map>
#include <unordered_map>
#include <queue>
#include <regex>

#pragma GCC optimize("Ofast")
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define rep1(i, n) for(int i = 1; i <= (n); ++i)
#define rep2(i, n) for(int i = 2; i < (n); ++i)
#define repr(i, n) for(int i = n; i >= 0; --i)
#define reprm(i, n) for(int i = n - 1; i >= 0; --i)
#define printynl(a) printf(a ? "yes\n" : "no\n")
#define printyn(a) printf(a ? "Yes\n" : "No\n")
#define printYN(a) printf(a ? "YES\n" : "NO\n")
#define printin(a) printf(a ? "possible\n" : "inposible\n")
#define printdb(a) printf("%.50lf\n", a)//少数出力
#define printdbd(a) printf("%.16lf\n", a)//少数出力(桁少なめ)
#define prints(s) printf("%s\n", s.c_str())//string出力
#define all(x) (x).begin(), (x).end()
#define allsum(a, b, c) ((a + b) * c / 2)//等差数列の和、初項,末項,項数
#define pb push_back
#define priq priority_queue
#define rpriq priq<int, vector<int>, greater<int>>
#define deg_to_rad(deg) (((deg)/360.0)*2.0*PI)
#define rad_to_deg(rad) (((rad)/2.0/PI)*360.0)
#define Please return
#define AC 0

using ll = long long;

constexpr int INF = 1073741823;
constexpr int MINF = -1073741823;
constexpr ll LINF = ll(4661686018427387903);
constexpr ll MOD = 1000000007;
const double PI = acos(-1);

using namespace std;

void scans(string& str) {
	char c;
	str = "";
	scanf("%c", &c);
	if (c == '\n')scanf("%c", &c);//最初の改行対策
	while (c != '\n' && c != -1) {
		str += c;
		scanf("%c", &c);
	}
}

void scanc(char& str) {
	char c;
	scanf("%c", &c);
	if (c == -1)return;
	while (c == '\n') {
		scanf("%c", &c);
	}
	str = c;
}

double acot(double x) {
	return PI / 2 - atan(x);
}

/*-----------------------------------------ここからコード-----------------------------------------*/

int main() {

	int n;
	scanf("%d", &n);
	rep(query, n) {
		ll x;
		scanf("%lld", &x);
		auto result = lldiv(x, 14LL);
		printYN(result.rem >= 1LL && result.rem <= 6LL);
	}

	Please AC;
}


/*
このコード、と～おれ!
Be accepted!
∧＿∧
（｡･ω･｡)つ━☆・*。
⊂　　 ノ 　　　・゜+.
　しーＪ　　　°。+ *´¨)
 　　　　　　　　　.· ´¸.·*´¨) ¸.·*¨)
		  　　　　　　　　　　(¸.·´ (¸.·'* ☆
					*/

#include <stdio.h>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstring>
#include <vector>
#include <numeric>
#include <iostream>
#include <random>
#include <map>
#include <unordered_map>
#include <queue>
#include <regex>

#pragma GCC optimize("Ofast")
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define rep1(i, n) for(int i = 1; i <= (n); ++i)
#define rep2(i, n) for(int i = 2; i < (n); ++i)
#define repr(i, n) for(int i = n; i >= 0; --i)
#define reprm(i, n) for(int i = n - 1; i >= 0; --i)
#define printynl(a) printf(a ? "yes\n" : "no\n")
#define printyn(a) printf(a ? "Yes\n" : "No\n")
#define printYN(a) printf(a ? "YES\n" : "NO\n")
#define printin(a) printf(a ? "possible\n" : "inposible\n")
#define printdb(a) printf("%.50lf\n", a)//少数出力
#define printdbd(a) printf("%.16lf\n", a)//少数出力(桁少なめ)
#define prints(s) printf("%s\n", s.c_str())//string出力
#define all(x) (x).begin(), (x).end()
#define allsum(a, b, c) ((a + b) * c / 2)//等差数列の和、初項,末項,項数
#define pb push_back
#define priq priority_queue
#define rpriq priq<int, vector<int>, greater<int>>
#define deg_to_rad(deg) (((deg)/360.0)*2.0*PI)
#define rad_to_deg(rad) (((rad)/2.0/PI)*360.0)
#define Please return
#define AC 0

using ll = long long;

constexpr int INF = 1073741823;
constexpr int MINF = -1073741823;
constexpr ll LINF = ll(4661686018427387903);
constexpr ll MOD = 1000000007;
const double PI = acos(-1);

using namespace std;

void scans(string& str) {
	char c;
	str = "";
	scanf("%c", &c);
	if (c == '\n')scanf("%c", &c);//最初の改行対策
	while (c != '\n' && c != -1) {
		str += c;
		scanf("%c", &c);
	}
}

void scanc(char& str) {
	char c;
	scanf("%c", &c);
	if (c == -1)return;
	while (c == '\n') {
		scanf("%c", &c);
	}
	str = c;
}

double acot(double x) {
	return PI / 2 - atan(x);
}

/*-----------------------------------------ここからコード-----------------------------------------*/

int main() {

	int n;
	scanf("%d", &n);
	rep(query, n) {
		unsigned long long x;
		scanf("%llu", &x);
		printYN(x % 14 >= 1 && x % 14 <= 6);
	}

	Please AC;
}


/*
このコード、と～おれ!
Be accepted!
∧＿∧
（｡･ω･｡)つ━☆・*。
⊂　　 ノ 　　　・゜+.
　しーＪ　　　°。+ *´¨)
 　　　　　　　　　.· ´¸.·*´¨) ¸.·*¨)
		  　　　　　　　　　　(¸.·´ (¸.·'* ☆
					*/

#include <stdio.h>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstring>
#include <vector>
#include <numeric>
#include <iostream>
#include <random>
#include <map>
#include <unordered_map>
#include <queue>
#include <regex>

#pragma GCC optimize("Ofast")
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define rep1(i, n) for(int i = 1; i <= (n); ++i)
#define rep2(i, n) for(int i = 2; i < (n); ++i)
#define repr(i, n) for(int i = n; i >= 0; --i)
#define reprm(i, n) for(int i = n - 1; i >= 0; --i)
#define printynl(a) printf(a ? "yes\n" : "no\n")
#define printyn(a) printf(a ? "Yes\n" : "No\n")
#define printYN(a) printf(a ? "YES\n" : "NO\n")
#define printin(a) printf(a ? "possible\n" : "inposible\n")
#define printdb(a) printf("%.50lf\n", a)//少数出力
#define printdbd(a) printf("%.16lf\n", a)//少数出力(桁少なめ)
#define prints(s) printf("%s\n", s.c_str())//string出力
#define all(x) (x).begin(), (x).end()
#define allsum(a, b, c) ((a + b) * c / 2)//等差数列の和、初項,末項,項数
#define pb push_back
#define priq priority_queue
#define rpriq priq<int, vector<int>, greater<int>>
#define deg_to_rad(deg) (((deg)/360.0)*2.0*PI)
#define rad_to_deg(rad) (((rad)/2.0/PI)*360.0)
#define Please return
#define AC 0

using ll = long long;

constexpr int INF = 1073741823;
constexpr int MINF = -1073741823;
constexpr ll LINF = ll(4661686018427387903);
constexpr ll MOD = 1000000007;
const double PI = acos(-1);

using namespace std;

void scans(string& str) {
	char c;
	str = "";
	scanf("%c", &c);
	if (c == '\n')scanf("%c", &c);//最初の改行対策
	while (c != '\n' && c != -1) {
		str += c;
		scanf("%c", &c);
	}
}

void scanc(char& str) {
	char c;
	scanf("%c", &c);
	if (c == -1)return;
	while (c == '\n') {
		scanf("%c", &c);
	}
	str = c;
}

double acot(double x) {
	return PI / 2 - atan(x);
}

/*-----------------------------------------ここからコード-----------------------------------------*/

int main() {

	int n;
	scanf("%d", &n);
	rep(query, n) {
		ll x;
		scanf("%lld", &x);
		printYN(x - 28LL <= 6LL);
	}

	Please AC;
}


/*
このコード、と～おれ!
Be accepted!
∧＿∧
（｡･ω･｡)つ━☆・*。
⊂　　 ノ 　　　・゜+.
　しーＪ　　　°。+ *´¨)
 　　　　　　　　　.· ´¸.·*´¨) ¸.·*¨)
		  　　　　　　　　　　(¸.·´ (¸.·'* ☆
					*/

#include <stdio.h>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstring>
#include <vector>
#include <numeric>
#include <iostream>
#include <random>
#include <map>
#include <unordered_map>
#include <queue>
#include <regex>

#pragma GCC optimize("Ofast")
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define rep1(i, n) for(int i = 1; i <= (n); ++i)
#define rep2(i, n) for(int i = 2; i < (n); ++i)
#define repr(i, n) for(int i = n; i >= 0; --i)
#define reprm(i, n) for(int i = n - 1; i >= 0; --i)
#define printynl(a) printf(a ? "yes\n" : "no\n")
#define printyn(a) printf(a ? "Yes\n" : "No\n")
#define printYN(a) printf(a ? "YES\n" : "NO\n")
#define printin(a) printf(a ? "possible\n" : "inposible\n")
#define printdb(a) printf("%.50lf\n", a)//少数出力
#define printdbd(a) printf("%.16lf\n", a)//少数出力(桁少なめ)
#define prints(s) printf("%s\n", s.c_str())//string出力
#define all(x) (x).begin(), (x).end()
#define allsum(a, b, c) ((a + b) * c / 2)//等差数列の和、初項,末項,項数
#define pb push_back
#define priq priority_queue
#define rpriq priq<int, vector<int>, greater<int>>
#define deg_to_rad(deg) (((deg)/360.0)*2.0*PI)
#define rad_to_deg(rad) (((rad)/2.0/PI)*360.0)
#define Please return
#define AC 0

using ll = long long;

constexpr int INF = 1073741823;
constexpr int MINF = -1073741823;
constexpr ll LINF = ll(4661686018427387903);
constexpr ll MOD = 1000000007;
const double PI = acos(-1);

using namespace std;

void scans(string& str) {
	char c;
	str = "";
	scanf("%c", &c);
	if (c == '\n')scanf("%c", &c);//最初の改行対策
	while (c != '\n' && c != -1) {
		str += c;
		scanf("%c", &c);
	}
}

void scanc(char& str) {
	char c;
	scanf("%c", &c);
	if (c == -1)return;
	while (c == '\n') {
		scanf("%c", &c);
	}
	str = c;
}

double acot(double x) {
	return PI / 2 - atan(x);
}

/*-----------------------------------------ここからコード-----------------------------------------*/

int main() {

	int n;
	scanf("%d", &n);
	rep(query, n) {
		ll x;
		scanf("%lld", &x);
		printYN(x % (7 * 2) <= 6);
	}

	Please AC;
}


/*
このコード、と～おれ!
Be accepted!
∧＿∧
（｡･ω･｡)つ━☆・*。
⊂　　 ノ 　　　・゜+.
　しーＪ　　　°。+ *´¨)
 　　　　　　　　　.· ´¸.·*´¨) ¸.·*¨)
		  　　　　　　　　　　(¸.·´ (¸.·'* ☆
					*/

#include <stdio.h>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstring>
#include <vector>
#include <numeric>
#include <iostream>
#include <random>
#include <map>
#include <unordered_map>
#include <queue>
#include <regex>

#pragma GCC optimize("Ofast")
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define rep1(i, n) for(int i = 1; i <= (n); ++i)
#define rep2(i, n) for(int i = 2; i < (n); ++i)
#define repr(i, n) for(int i = n; i >= 0; --i)
#define reprm(i, n) for(int i = n - 1; i >= 0; --i)
#define printynl(a) printf(a ? "yes\n" : "no\n")
#define printyn(a) printf(a ? "Yes\n" : "No\n")
#define printYN(a) printf(a ? "YES\n" : "NO\n")
#define printin(a) printf(a ? "possible\n" : "inposible\n")
#define printdb(a) printf("%.50lf\n", a)//少数出力
#define printdbd(a) printf("%.16lf\n", a)//少数出力(桁少なめ)
#define prints(s) printf("%s\n", s.c_str())//string出力
#define all(x) (x).begin(), (x).end()
#define allsum(a, b, c) ((a + b) * c / 2)//等差数列の和、初項,末項,項数
#define pb push_back
#define priq priority_queue
#define rpriq priq<int, vector<int>, greater<int>>
#define deg_to_rad(deg) (((deg)/360.0)*2.0*PI)
#define rad_to_deg(rad) (((rad)/2.0/PI)*360.0)
#define Please return
#define AC 0

using ll = long long;

constexpr int INF = 1073741823;
constexpr int MINF = -1073741823;
constexpr ll LINF = ll(4661686018427387903);
constexpr ll MOD = 1000000007;
const double PI = acos(-1);

using namespace std;

void scans(string& str) {
	char c;
	str = "";
	scanf("%c", &c);
	if (c == '\n')scanf("%c", &c);//最初の改行対策
	while (c != '\n' && c != -1) {
		str += c;
		scanf("%c", &c);
	}
}

void scanc(char& str) {
	char c;
	scanf("%c", &c);
	if (c == -1)return;
	while (c == '\n') {
		scanf("%c", &c);
	}
	str = c;
}

double acot(double x) {
	return PI / 2 - atan(x);
}

/*-----------------------------------------ここからコード-----------------------------------------*/

int main() {

	int n;
	scanf("%d", &n);
	rep(query, n) {
		ll x;
		scanf("%lld", &x);
		printYN(x - 28 <= 6);
	}

	Please AC;
}


/*
このコード、と～おれ!
Be accepted!
∧＿∧
（｡･ω･｡)つ━☆・*。
⊂　　 ノ 　　　・゜+.
　しーＪ　　　°。+ *´¨)
 　　　　　　　　　.· ´¸.·*´¨) ¸.·*¨)
		  　　　　　　　　　　(¸.·´ (¸.·'* ☆
					*/

#include <stdio.h>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstring>
#include <vector>
#include <numeric>
#include <iostream>
#include <random>
#include <map>
#include <unordered_map>
#include <queue>
#include <regex>

#pragma GCC optimize("Ofast")
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define rep1(i, n) for(int i = 1; i <= (n); ++i)
#define rep2(i, n) for(int i = 2; i < (n); ++i)
#define repr(i, n) for(int i = n; i >= 0; --i)
#define reprm(i, n) for(int i = n - 1; i >= 0; --i)
#define printynl(a) printf(a ? "yes\n" : "no\n")
#define printyn(a) printf(a ? "Yes\n" : "No\n")
#define printYN(a) printf(a ? "YES\n" : "NO\n")
#define printin(a) printf(a ? "possible\n" : "inposible\n")
#define printdb(a) printf("%.50lf\n", a)//少数出力
#define printdbd(a) printf("%.16lf\n", a)//少数出力(桁少なめ)
#define prints(s) printf("%s\n", s.c_str())//string出力
#define all(x) (x).begin(), (x).end()
#define allsum(a, b, c) ((a + b) * c / 2)//等差数列の和、初項,末項,項数
#define pb push_back
#define priq priority_queue
#define rpriq priq<int, vector<int>, greater<int>>
#define deg_to_rad(deg) (((deg)/360.0)*2.0*PI)
#define rad_to_deg(rad) (((rad)/2.0/PI)*360.0)
#define Please return
#define AC 0

using ll = long long;

constexpr int INF = 1073741823;
constexpr int MINF = -1073741823;
constexpr ll LINF = ll(4661686018427387903);
constexpr ll MOD = 1000000007;
const double PI = acos(-1);

using namespace std;

void scans(string& str) {
	char c;
	str = "";
	scanf("%c", &c);
	if (c == '\n')scanf("%c", &c);//最初の改行対策
	while (c != '\n' && c != -1) {
		str += c;
		scanf("%c", &c);
	}
}

void scanc(char& str) {
	char c;
	scanf("%c", &c);
	if (c == -1)return;
	while (c == '\n') {
		scanf("%c", &c);
	}
	str = c;
}

double acot(double x) {
	return PI / 2 - atan(x);
}

/*-----------------------------------------ここからコード-----------------------------------------*/

int main() {

	int n;
	scanf("%d", &n);
	rep(query, n) {
		ll x;
		scanf("%lld", &x);
		printYN(x % 14LL >= 1LL && x % 14LL <= 6LL);
	}

	Please AC;
}


/*
このコード、と～おれ!
Be accepted!
∧＿∧
（｡･ω･｡)つ━☆・*。
⊂　　 ノ 　　　・゜+.
　しーＪ　　　°。+ *´¨)
 　　　　　　　　　.· ´¸.·*´¨) ¸.·*¨)
		  　　　　　　　　　　(¸.·´ (¸.·'* ☆
					*/

#include <stdio.h>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstring>
#include <vector>
#include <numeric>
#include <iostream>
#include <random>
#include <map>
#include <unordered_map>
#include <queue>
#include <regex>

#pragma GCC optimize("Ofast")
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define rep1(i, n) for(int i = 1; i <= (n); ++i)
#define rep2(i, n) for(int i = 2; i < (n); ++i)
#define repr(i, n) for(int i = n; i >= 0; --i)
#define reprm(i, n) for(int i = n - 1; i >= 0; --i)
#define printynl(a) printf(a ? "yes\n" : "no\n")
#define printyn(a) printf(a ? "Yes\n" : "No\n")
#define printYN(a) printf(a ? "YES\n" : "NO\n")
#define printin(a) printf(a ? "possible\n" : "inposible\n")
#define printdb(a) printf("%.50lf\n", a)//少数出力
#define printdbd(a) printf("%.16lf\n", a)//少数出力(桁少なめ)
#define prints(s) printf("%s\n", s.c_str())//string出力
#define all(x) (x).begin(), (x).end()
#define allsum(a, b, c) ((a + b) * c / 2)//等差数列の和、初項,末項,項数
#define pb push_back
#define priq priority_queue
#define rpriq priq<int, vector<int>, greater<int>>
#define deg_to_rad(deg) (((deg)/360.0)*2.0*PI)
#define rad_to_deg(rad) (((rad)/2.0/PI)*360.0)
#define Please return
#define AC 0

using ll = long long;

constexpr int INF = 1073741823;
constexpr int MINF = -1073741823;
constexpr ll LINF = ll(4661686018427387903);
constexpr ll MOD = 1000000007;
const double PI = acos(-1);

using namespace std;

void scans(string& str) {
	char c;
	str = "";
	scanf("%c", &c);
	if (c == '\n')scanf("%c", &c);//最初の改行対策
	while (c != '\n' && c != -1) {
		str += c;
		scanf("%c", &c);
	}
}

void scanc(char& str) {
	char c;
	scanf("%c", &c);
	if (c == -1)return;
	while (c == '\n') {
		scanf("%c", &c);
	}
	str = c;
}

double acot(double x) {
	return PI / 2 - atan(x);
}

/*-----------------------------------------ここからコード-----------------------------------------*/

int main() {

	int n;
	scanf("%d", &n);
	rep(query, n) {
		unsigned int x;
		scanf("%ud", &x);
		printYN(x % 14 >= 1 && x % 14 <= 6);
	}

	Please AC;
}


/*
このコード、と～おれ!
Be accepted!
∧＿∧
（｡･ω･｡)つ━☆・*。
⊂　　 ノ 　　　・゜+.
　しーＪ　　　°。+ *´¨)
 　　　　　　　　　.· ´¸.·*´¨) ¸.·*¨)
		  　　　　　　　　　　(¸.·´ (¸.·'* ☆
					*/

#include <stdio.h>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstring>
#include <vector>
#include <numeric>
#include <iostream>
#include <random>
#include <map>
#include <unordered_map>
#include <queue>
#include <regex>

#pragma GCC optimize("Ofast")
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define rep1(i, n) for(int i = 1; i <= (n); ++i)
#define rep2(i, n) for(int i = 2; i < (n); ++i)
#define repr(i, n) for(int i = n; i >= 0; --i)
#define reprm(i, n) for(int i = n - 1; i >= 0; --i)
#define printynl(a) printf(a ? "yes\n" : "no\n")
#define printyn(a) printf(a ? "Yes\n" : "No\n")
#define printYN(a) printf(a ? "YES\n" : "NO\n")
#define printin(a) printf(a ? "possible\n" : "inposible\n")
#define printdb(a) printf("%.50lf\n", a)//少数出力
#define printdbd(a) printf("%.16lf\n", a)//少数出力(桁少なめ)
#define prints(s) printf("%s\n", s.c_str())//string出力
#define all(x) (x).begin(), (x).end()
#define allsum(a, b, c) ((a + b) * c / 2)//等差数列の和、初項,末項,項数
#define pb push_back
#define priq priority_queue
#define rpriq priq<int, vector<int>, greater<int>>
#define deg_to_rad(deg) (((deg)/360.0)*2.0*PI)
#define rad_to_deg(rad) (((rad)/2.0/PI)*360.0)
#define Please return
#define AC 0

using ll = long long;

constexpr int INF = 1073741823;
constexpr int MINF = -1073741823;
constexpr ll LINF = ll(4661686018427387903);
constexpr ll MOD = 1000000007;
const double PI = acos(-1);

using namespace std;

void scans(string& str) {
	char c;
	str = "";
	scanf("%c", &c);
	if (c == '\n')scanf("%c", &c);//最初の改行対策
	while (c != '\n' && c != -1) {
		str += c;
		scanf("%c", &c);
	}
}

void scanc(char& str) {
	char c;
	scanf("%c", &c);
	if (c == -1)return;
	while (c == '\n') {
		scanf("%c", &c);
	}
	str = c;
}

double acot(double x) {
	return PI / 2 - atan(x);
}

/*-----------------------------------------ここからコード-----------------------------------------*/

int main() {

	int n;
	scanf("%d", &n);
	rep(query, n) {
		ll x;
		scanf("%lld", &x);
		while (x >= 7) {
			x -= 14;
		}
		printYN(1 <= x && x <= 6);
	}

	Please AC;
}


/*
このコード、と～おれ!
Be accepted!
∧＿∧
（｡･ω･｡)つ━☆・*。
⊂　　 ノ 　　　・゜+.
　しーＪ　　　°。+ *´¨)
 　　　　　　　　　.· ´¸.·*´¨) ¸.·*¨)
		  　　　　　　　　　　(¸.·´ (¸.·'* ☆
					*/

#include <stdio.h>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstring>
#include <vector>
#include <numeric>
#include <iostream>
#include <random>
#include <map>
#include <unordered_map>
#include <queue>
#include <regex>

#pragma GCC optimize("Ofast")
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define rep1(i, n) for(int i = 1; i <= (n); ++i)
#define rep2(i, n) for(int i = 2; i < (n); ++i)
#define repr(i, n) for(int i = n; i >= 0; --i)
#define reprm(i, n) for(int i = n - 1; i >= 0; --i)
#define printynl(a) printf(a ? "yes\n" : "no\n")
#define printyn(a) printf(a ? "Yes\n" : "No\n")
#define printYN(a) printf(a ? "YES\n" : "NO\n")
#define printin(a) printf(a ? "possible\n" : "inposible\n")
#define printdb(a) printf("%.50lf\n", a)//少数出力
#define printdbd(a) printf("%.16lf\n", a)//少数出力(桁少なめ)
#define prints(s) printf("%s\n", s.c_str())//string出力
#define all(x) (x).begin(), (x).end()
#define allsum(a, b, c) ((a + b) * c / 2)//等差数列の和、初項,末項,項数
#define pb push_back
#define priq priority_queue
#define rpriq priq<int, vector<int>, greater<int>>
#define deg_to_rad(deg) (((deg)/360.0)*2.0*PI)
#define rad_to_deg(rad) (((rad)/2.0/PI)*360.0)
#define Please return
#define AC 0

using ll = long long;

constexpr int INF = 1073741823;
constexpr int MINF = -1073741823;
constexpr ll LINF = ll(4661686018427387903);
constexpr ll MOD = 1000000007;
const double PI = acos(-1);

using namespace std;

void scans(string& str) {
	char c;
	str = "";
	scanf("%c", &c);
	if (c == '\n')scanf("%c", &c);//最初の改行対策
	while (c != '\n' && c != -1) {
		str += c;
		scanf("%c", &c);
	}
}

void scanc(char& str) {
	char c;
	scanf("%c", &c);
	if (c == -1)return;
	while (c == '\n') {
		scanf("%c", &c);
	}
	str = c;
}

double acot(double x) {
	return PI / 2 - atan(x);
}

/*-----------------------------------------ここからコード-----------------------------------------*/

int main() {

	int n;
	scanf("%d", &n);
	rep(query, n) {
		ll x;
		scanf("%lld", &x);
		printYN(x - 28LL <= 6LL && x >= 29);
	}

	Please AC;
}


/*
このコード、と～おれ!
Be accepted!
∧＿∧
（｡･ω･｡)つ━☆・*。
⊂　　 ノ 　　　・゜+.
　しーＪ　　　°。+ *´¨)
 　　　　　　　　　.· ´¸.·*´¨) ¸.·*¨)
		  　　　　　　　　　　(¸.·´ (¸.·'* ☆
					*/

#include <stdio.h>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstring>
#include <vector>
#include <numeric>
#include <iostream>
#include <random>
#include <map>
#include <unordered_map>
#include <queue>
#include <regex>

#pragma GCC optimize("Ofast")
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define rep1(i, n) for(int i = 1; i <= (n); ++i)
#define rep2(i, n) for(int i = 2; i < (n); ++i)
#define repr(i, n) for(int i = n; i >= 0; --i)
#define reprm(i, n) for(int i = n - 1; i >= 0; --i)
#define printynl(a) printf(a ? "yes\n" : "no\n")
#define printyn(a) printf(a ? "Yes\n" : "No\n")
#define printYN(a) printf(a ? "YES\n" : "NO\n")
#define printin(a) printf(a ? "possible\n" : "inposible\n")
#define printdb(a) printf("%.50lf\n", a)//少数出力
#define printdbd(a) printf("%.16lf\n", a)//少数出力(桁少なめ)
#define prints(s) printf("%s\n", s.c_str())//string出力
#define all(x) (x).begin(), (x).end()
#define allsum(a, b, c) ((a + b) * c / 2)//等差数列の和、初項,末項,項数
#define pb push_back
#define priq priority_queue
#define rpriq priq<int, vector<int>, greater<int>>
#define deg_to_rad(deg) (((deg)/360.0)*2.0*PI)
#define rad_to_deg(rad) (((rad)/2.0/PI)*360.0)
#define Please return
#define AC 0

using ll = long long;

constexpr int INF = 1073741823;
constexpr int MINF = -1073741823;
constexpr ll LINF = ll(4661686018427387903);
constexpr ll MOD = 1000000007;
const double PI = acos(-1);

using namespace std;

void scans(string& str) {
	char c;
	str = "";
	scanf("%c", &c);
	if (c == '\n')scanf("%c", &c);//最初の改行対策
	while (c != '\n' && c != -1) {
		str += c;
		scanf("%c", &c);
	}
}

void scanc(char& str) {
	char c;
	scanf("%c", &c);
	if (c == -1)return;
	while (c == '\n') {
		scanf("%c", &c);
	}
	str = c;
}

double acot(double x) {
	return PI / 2 - atan(x);
}

/*-----------------------------------------ここからコード-----------------------------------------*/

int main() {

	int n;
	scanf("%d", &n);
	rep(query, n) {
		ll x;
		scanf("%lld", &x);
		printYN(x % (7 * 2) <= 6 && x % (7 * 2) >= 1);
	}

	Please AC;
}


/*
このコード、と～おれ!
Be accepted!
∧＿∧
（｡･ω･｡)つ━☆・*。
⊂　　 ノ 　　　・゜+.
　しーＪ　　　°。+ *´¨)
 　　　　　　　　　.· ´¸.·*´¨) ¸.·*¨)
		  　　　　　　　　　　(¸.·´ (¸.·'* ☆
					*/

#include <stdio.h>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstring>
#include <vector>
#include <numeric>
#include <iostream>
#include <random>
#include <map>
#include <unordered_map>
#include <queue>
#include <regex>

#pragma GCC optimize("Ofast")
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define rep1(i, n) for(int i = 1; i <= (n); ++i)
#define rep2(i, n) for(int i = 2; i < (n); ++i)
#define repr(i, n) for(int i = n; i >= 0; --i)
#define reprm(i, n) for(int i = n - 1; i >= 0; --i)
#define printynl(a) printf(a ? "yes\n" : "no\n")
#define printyn(a) printf(a ? "Yes\n" : "No\n")
#define printYN(a) printf(a ? "YES\n" : "NO\n")
#define printin(a) printf(a ? "possible\n" : "inposible\n")
#define printdb(a) printf("%.50lf\n", a)//少数出力
#define printdbd(a) printf("%.16lf\n", a)//少数出力(桁少なめ)
#define prints(s) printf("%s\n", s.c_str())//string出力
#define all(x) (x).begin(), (x).end()
#define allsum(a, b, c) ((a + b) * c / 2)//等差数列の和、初項,末項,項数
#define pb push_back
#define priq priority_queue
#define rpriq priq<int, vector<int>, greater<int>>
#define deg_to_rad(deg) (((deg)/360.0)*2.0*PI)
#define rad_to_deg(rad) (((rad)/2.0/PI)*360.0)
#define Please return
#define AC 0

using ll = long long;

constexpr int INF = 1073741823;
constexpr int MINF = -1073741823;
constexpr ll LINF = ll(4661686018427387903);
constexpr ll MOD = 1000000007;
const double PI = acos(-1);

using namespace std;

void scans(string& str) {
	char c;
	str = "";
	scanf("%c", &c);
	if (c == '\n')scanf("%c", &c);//最初の改行対策
	while (c != '\n' && c != -1) {
		str += c;
		scanf("%c", &c);
	}
}

void scanc(char& str) {
	char c;
	scanf("%c", &c);
	if (c == -1)return;
	while (c == '\n') {
		scanf("%c", &c);
	}
	str = c;
}

double acot(double x) {
	return PI / 2 - atan(x);
}

/*-----------------------------------------ここからコード-----------------------------------------*/

int main() {

	int n;
	scanf("%d", &n);
	rep(query, n) {
		unsigned long long x;
		scanf("%llu", &x);
		auto result = lldiv(x, 14);
		printYN(result.rem >= 1 && result.rem <= 6 && x > 14);
	}

	Please AC;
}


/*
このコード、と～おれ!
Be accepted!
∧＿∧
（｡･ω･｡)つ━☆・*。
⊂　　 ノ 　　　・゜+.
　しーＪ　　　°。+ *´¨)
 　　　　　　　　　.· ´¸.·*´¨) ¸.·*¨)
		  　　　　　　　　　　(¸.·´ (¸.·'* ☆
					*/

#include <stdio.h>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstring>
#include <vector>
#include <numeric>
#include <iostream>
#include <random>
#include <map>
#include <unordered_map>
#include <queue>
#include <regex>

#pragma GCC optimize("Ofast")
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define rep1(i, n) for(int i = 1; i <= (n); ++i)
#define rep2(i, n) for(int i = 2; i < (n); ++i)
#define repr(i, n) for(int i = n; i >= 0; --i)
#define reprm(i, n) for(int i = n - 1; i >= 0; --i)
#define printynl(a) printf(a ? "yes\n" : "no\n")
#define printyn(a) printf(a ? "Yes\n" : "No\n")
#define printYN(a) printf(a ? "YES\n" : "NO\n")
#define printin(a) printf(a ? "possible\n" : "inposible\n")
#define printdb(a) printf("%.50lf\n", a)//少数出力
#define printdbd(a) printf("%.16lf\n", a)//少数出力(桁少なめ)
#define prints(s) printf("%s\n", s.c_str())//string出力
#define all(x) (x).begin(), (x).end()
#define allsum(a, b, c) ((a + b) * c / 2)//等差数列の和、初項,末項,項数
#define pb push_back
#define priq priority_queue
#define rpriq priq<int, vector<int>, greater<int>>
#define deg_to_rad(deg) (((deg)/360.0)*2.0*PI)
#define rad_to_deg(rad) (((rad)/2.0/PI)*360.0)
#define Please return
#define AC 0

using ll = long long;

constexpr int INF = 1073741823;
constexpr int MINF = -1073741823;
constexpr ll LINF = ll(4661686018427387903);
constexpr ll MOD = 1000000007;
const double PI = acos(-1);

using namespace std;

void scans(string& str) {
	char c;
	str = "";
	scanf("%c", &c);
	if (c == '\n')scanf("%c", &c);//最初の改行対策
	while (c != '\n' && c != -1) {
		str += c;
		scanf("%c", &c);
	}
}

void scanc(char& str) {
	char c;
	scanf("%c", &c);
	if (c == -1)return;
	while (c == '\n') {
		scanf("%c", &c);
	}
	str = c;
}

double acot(double x) {
	return PI / 2 - atan(x);
}

/*-----------------------------------------ここからコード-----------------------------------------*/

int main() {

	int n;
	scanf("%d", &n);
	rep(query, n) {
		unsigned long long x;
		scanf("%llu", &x);
		auto result = lldiv(x, 14);
		printYN(result.rem >= 1 && result.rem <= 6);
	}

	Please AC;
}


#include <bits/stdc++.h>
#define pb push_back
#define ll long long
using namespace std;
int main() {
	// your code goes here
  int n;
  cin>>n;
 ll int a;
  for(int i=0;i<n;i++){
  cin>>a;
  int f=0;
    ll int k=a%14;
  //  a-=(k*14);
    if(k>=1&&k<=6)
    cout<<"YES"<<endl;
    else
    cout<<"NO"<<endl;
  }
    return 0;
}


#include <bits/stdc++.h>
#define pb push_back
#define ll long long
using namespace std;
int main() {
	// your code goes here
  int n;
  cin>>n;
  ll int a;
  for(int i=0;i<n;i++){
  cin>>a;
ll  int ct=a/21;
ll int ct1= ((ct+1)*21)-(ct*7)-a;
 if(ct1<=6&&ct1>=1)
  cout<<"YES"<<endl;
  else
  cout<<"NO"<<endl;
  }
    return 0;
}


#include <bits/stdc++.h>
#define pb push_back
#define ll long long
using namespace std;
int main() {
	// your code goes here
  int n;
  cin>>n;
  int a;
  for(int i=0;i<n;i++){
  cin>>a;
  int ct=a/21;
 int ct1= ((ct+1)*21)-(ct*7)-a;
 if(ct1<=6&&ct1>=1)
  cout<<"YES"<<endl;
  else
  cout<<"NO"<<endl;
  }
    return 0;
}


#include <bits/stdc++.h>
#define pb push_back
#define ll long long
using namespace std;
int main() {
	// your code goes here
  int n;
  cin>>n;
 ll int a;
  for(int i=0;i<n;i++){
  cin>>a;
  int f=0;
    ll int k=a/14;
    a-=(k*14);
    if(a>=1&&a<=6)
    cout<<"YES"<<endl;
    else
    cout<<"NO"<<endl;
  }
    return 0;
}


#include <bits/stdc++.h>
#define pb push_back
#define ll long long
using namespace std;
int main() {
	// your code goes here
  int n;
  cin>>n;
 ll int a;
  for(int i=0;i<n;i++){
  cin>>a;
  int f=0;
    ll int k=a/14;
    ll int k1=a%14;
    if(k1>=1&&k1<=6&&k>=1)
    cout<<"YES"<<endl;
    else
    cout<<"NO"<<endl;
  }
    return 0;
}


#include <bits/stdc++.h>
#define pb push_back
#define ll long long
using namespace std;
int main() {
	// your code goes here
  int n;
  cin>>n;
 ll int a;
  for(int i=0;i<n;i++){
  cin>>a;
  int f=0;
   while(a>14)
   {
       if(a>=15&&a<=20){
       f=1;
       break;}
       a-=14;
   }
    if(f)
    cout<<"YES"<<endl;
    else
    cout<<"NO"<<endl;
  }
    return 0;
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

#pragma GCC optimize("Ofast")

int main(){
long long int t;
cin >> t;
string x[t];
for(long long int i=0;i<t;++i){
    cin >> x[i];
}
long long int num=0;
long long int tmp=0;
long long int res=0;
long long int L=0;
for(long long int i=0;i<t;++i){
    L=x[i].length();
    num =(long long int) atoi(x[i].c_str()) % 14;
    tmp =(long long int) atoi(x[i].c_str());
    if(L<=2){
    if(tmp>=1 && tmp <= 14){
    cout << "NO" << endl;
    }
    else{
        cout << "YES" << endl;
    }
    }
    else{
    if(num>=1 && num <=6){
        cout << "YES" << endl;
    }
    else{
        cout << "NO" << endl;
    }
    }
}

}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

#pragma GCC optimize("Ofast")

int main(){
long long int t;
cin >> t;
vector<string> x(t);
for(long long int i=0;i<t;++i){
    cin >> x[i];
}
long long int num=0;
long long int tmp=0;
for(long long int i=0;i<t;++i){
    num = atoi(x[i].c_str()) % 14;
    tmp = atoi(x[i].c_str());
    if(tmp==0){
        cout << "YES" << endl;
    }
    else{
        if(tmp==num){
            cout << "NO" << endl;
        }
        else{
    if(num>=1 && num <=6){
        cout << "YES" << endl;
    }
    else{
        cout << "NO" << endl;
    }
    }
}
}
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

#pragma GCC optimize("Ofast")

int main(){
long long int t;
cin >> t;
vector<string> x(t);
for(long long int i=0;i<t;++i){
    cin >> x[i];
}
long long int num=0;
long long int tmp=0;
for(long long int i=0;i<t;++i){
    num = atoi(x[i].c_str()) % 14;
    tmp = atoi(x[i].c_str());
        if(tmp==num){
            cout << "NO" << endl;
        }
        else{
    if(num>=1 && num <=6){
        cout << "YES" << endl;
    }
    else{
        cout << "NO" << endl;
    }
    }
}
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

#pragma GCC optimize("Ofast")

int main(){
long long int t;
cin >> t;
long long int x[t];
for(long long int i=0;i<t;++i){
    cin >> x[i];
}
long long int num=0;
for(long long int i=0;i<t;++i){
    num = x[i] % 14;
    if(num>=0 && num <=6){
        cout << "YES" << endl;
    }
    else{
        cout << "NO" << endl;
    }
}
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

#pragma GCC optimize("Ofast")

int main(){
long long int t;
cin >> t;
vector<string> x(t);
for(long long int i=0;i<t;++i){
    cin >> x[i];
}
long long int num=0;
long long int tmp=0;
for(long long int i=0;i<t;++i){
    num = atoi(x[i].c_str())%14;
    tmp = atoi(x[i].c_str());
    if(tmp==0){
        cout << "YES" << endl;
    }
    else{
    if(num>0 && num <=6){
        cout << "YES" << endl;
    }
    else{
        cout << "NO" << endl;
    }
    }
}
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

#pragma GCC optimize("Ofast")

int main(){
long long int t;
cin >> t;
string x[t];
for(long long int i=0;i<t;++i){
    cin >> x[i];
}
long long int num=0;
long long int tmp=0;
long long int res=0;
for(long long int i=0;i<t;++i){
    num =(long long int) atoi(x[i].c_str()) % 14;
    tmp =(long long int) atoi(x[i].c_str());

    if(tmp <= 14){
    cout << "NO" << endl;
    }
    else{
    if(num>=1 && num <=6){
        cout << "YES" << endl;
    }
    else{
        cout << "NO" << endl;
    }
    }
}
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

#pragma GCC optimize("Ofast")

int main(){
long long int t;
cin >> t;
vector<string> x(t);
for(long long int i=0;i<t;++i){
    cin >> x[i];
}
long long int num=0;
for(long long int i=0;i<t;++i){
    num = atoi(x[i].c_str())%14;
    if(num>0 && num <=6){
        cout << "YES" << endl;
    }
    else{
        cout << "NO" << endl;
    }
}
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

#pragma GCC optimize("Ofast")

int main(){
long long int t;
cin >> t;
vector<string> x(t);
for(long long int i=0;i<t;++i){
    cin >> x[i];
}
long long int num=0;
long long int tmp=0;
for(long long int i=0;i<t;++i){
    num = atoi(x[i].c_str()) % 14;
    tmp = atoi(x[i].c_str());
        if(tmp<=14 && tmp>=0){
            cout << "NO" << endl;
        }
        else{
    if(num>=1 && num <=6){
        cout << "YES" << endl;
    }
    else{
        cout << "NO" << endl;
    }
    }
}
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

#pragma GCC optimize("Ofast")

int main(){
long long int t;
cin >> t;
vector<string> x(t);
for(long long int i=0;i<t;++i){
    cin >> x[i];
}
long long int num=0;
long long int tmp=0;
long long int res=0;
for(long long int i=0;i<t;++i){
    num = atoi(x[i].c_str()) % 14;
    tmp = atoi(x[i].c_str());

    res = atoi(x[i].c_str())/14;
    if(res==0){
        cout << "NO" << endl;
    }
    else{
    if(num>=1 && num <=6){
        cout << "YES" << endl;
    }
    else{
        cout << "NO" << endl;
    }
    }
}
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

#pragma GCC optimize("Ofast")

int main(){
long long int t;
cin >> t;
string x[t];
for(long long int i=0;i<t;++i){
    cin >> x[i];
}
long long int num=0;
long long int tmp=0;
long long int res=0;
long long int L=0;
for(long long int i=0;i<t;++i){
    L=x[i].length();
    num =(long long int) atoi(x[i].c_str()) % 14;
    tmp =(long long int) atoi(x[i].c_str());
    if(L<=2){
    if(tmp>=1 && tmp <= 14){
    cout << "NO" << endl;
    }
    else{
            if(num>=1 && num <=6){
        cout << "YES" << endl;
    }
    else{
        cout << "NO" << endl;
    }
    }
    }
    else{
    if(num>=1 && num <=6){
        cout << "YES" << endl;
    }
    else{
        cout << "NO" << endl;
    }
    }
}
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

#pragma GCC optimize("Ofast")

int main(){
long long int t;
cin >> t;
vector<string> x(t);
for(long long int i=0;i<t;++i){
    cin >> x[i];
}
long long int num=0;
for(long long int i=0;i<t;++i){
    num = atoi(x[i].c_str())%14;
    if(num>=0 && num <=6){
        cout << "YES" << endl;
    }
    else{
        cout << "NO" << endl;
    }
}
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

#pragma GCC optimize("Ofast")

int main(){
long long int t;
cin >> t;
vector<unsigned long long int> x(t);
for(long long int i=0;i<t;++i){
    cin >> x[i];
}
long long int num=0;
string tmp;
long long int res=0;
long long int L=0;
for(long long int i=0;i<t;++i){
    num =x[i] % 14;
    tmp =to_string(x[i]);
    L=tmp.length();
    if(L<=2){
    if(x[i]>=1 && x[i] <= 14){
    cout << "NO" << endl;
    }
    else{
        if(num>=1 && num <=6){
        cout << "YES" << endl;
    }
    else{
        cout << "NO" << endl;
    }
    }
    }
    else{
    if(num>=1 && num <=6){
        cout << "YES" << endl;
    }
    else{
        cout << "NO" << endl;
    }
    }
}
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
  long long t, a;
  cin >> t;
  for(int i = 0; i < t; i++){
    cin >> a;
    if(a % 14 < 7 && a% 14 != 0 && a > 14){
      cout << "yes" << endl;
    }
    else {
      cout << "no" << endl;
    }
  }
   return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
  int t, a;
  cin >> t;
  for(int i = 0; i < t; i++){
    cin >> a;
    if(a % 14 < 7 && a% 14 != 0){
      cout << "yes" << endl;
    }
    else cout << "no" << endl;
  }
   return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
  int t, a;
  cin >> t;
  for(int i = 0; i < t; i++){
    cin >> a;
    if(a % 14 < 7 && a% 14 != 0 && a > 14){
      cout << "yes" << endl;
    }
    else cout << "no" << endl;
  }
   return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
  int t, a;
  cin >> t;
  for(int i = 0; i < t; i++){
    cin >> a;
    if(a % 14 < 7 && a% 14 != 0 && a > 14){
      cout << "yes" << endl;
    }
    else {
      cout << "no" << endl;
    }
  }
   return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
  int t, a;
  cin >> t;
  for(int i = 0; i < t; i++){
    cin >> a;
    if(a % 14 > 6){
      cout << "no" << endl;
    }
    else cout << "yes" << endl;
  }
   return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
  int t, a;
  cin >> t;
  for(int i = 0; i < t; i++){
    cin >> a;
    if(a % 14 > 6 or a % 14 == 0 or a < 15){
      cout << "no" << endl;
    }
    else cout << "yes" << endl;
  }
   return 0;
}


#include <iostream>
using namespace std;
int main()
{
int n;
cin>>n;
int niz[100000];
for(int i=0;i<n;i++)
{
cin>>niz[i];
if(niz[i]%14<=6)
cout<<"YES"<<endl;
else
cout<<"NO"<<endl;
}
return 0;
}


#include <iostream>
using namespace std;
int main()
{
long long n,o,d;
cin>>n;
unsigned long long niz[1001];
for(int i=0;i<n;i++)
{
cin>>niz[i];
o=niz[i]%14;
d=niz[i]/14;
if(d>=1&&(o>=1&&o<=6))
cout<<"YES"<<endl;
else
cout<<"NO"<<endl;
}
return 0;
}


#include <iostream>
using namespace std;
int main()
{
int n;
cin>>n;
int niz[100000];
for(int i=0;i<n;i++)
{
cin>>niz[i];
int o=niz[i]%14;
int d=niz[i]/14;
if(d>=1&&(o>=1&&o<=6))
cout<<"YES"<<endl;
else
cout<<"NO"<<endl;
}
return 0;
}


#include <iostream>
using namespace std;
int main()
{
int n;
cin>>n;
long long niz[1001];
for(int i=0;i<n;i++)
{
cin>>niz[i];
int o=niz[i]%14;
int d=niz[i]/14;
if(d>=1&&(o>=1&&o<=6))
cout<<"YES"<<endl;
else
cout<<"NO"<<endl;
}
return 0;
}


#include <iostream>
using namespace std;
int main()
{
long n,o,d;
cin>>n;
long long niz[1001];
for(int i=0;i<n;i++)
{
cin>>niz[i];
o=niz[i]%14;
d=niz[i]/14;
if(d>=1&&(o>=1&&o<=6))
cout<<"YES"<<endl;
else
cout<<"NO"<<endl;
}
return 0;
}


#include <iostream>
using namespace std;
int main()
{
int n;
cin>>n;
int niz[100000];
for(int i=0;i<n;i++)
{
cin>>niz[i];
if(niz[i]>=15&&niz[i]%14<=6)
{
	if(niz[i]%14>=1)
	cout<<"YES"<<endl;
	else
	cout<<"NO"<<endl;
}
else
cout<<"NO"<<endl;
}
return 0;
}


#include <iostream>
using namespace std;
int main()
{
int n;
cin>>n;
int niz[100000];
for(int i=0;i<n;i++)
{
cin>>niz[i];
if(niz[i]%14<=6&&niz[i]/14>=1)
cout<<"YES"<<endl;
else
cout<<"NO"<<endl;
}
return 0;
}


#include <iostream>
using namespace std;
int main()
{
int n;
cin>>n;
int niz[100000];
for(int i=0;i<n;i++)
{
cin>>niz[i];
if((niz[i]%14>=1&&niz[i]%14<=6)&&niz[i]/14>=1)
cout<<"YES"<<endl;
else
cout<<"NO"<<endl;
}
return 0;
}


#include <bits/stdc++.h>  // This will work only for g++ compiler.
#include <ext/pb_ds/assoc_container.hpp> // Used to include policy based data structure
using namespace __gnu_pbds;  // Only for g++ compiler
using namespace std;

#define for0(i, n) for (int i = 0; i < (int)(n); ++i) // 0 based indexing
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i) // 1 based indexing
#define forc(i, l, r) for (int i = (int)(l); i <= (int)(r); ++i) // closed interver from l to r r inclusive
#define forr0(i, n) for (int i = (int)(n) - 1; i >= 0; --i) // reverse 0 based.
#define forr1(i, n) for (int i = (int)(n); i >= 1; --i) // reverse 1 based
#define max(a, b)  (a > b) ?a :b  // max of 2 elements
#define min(a, b)  (a < b) ?a :b  // min of 2 elements

//short hand for usual tokens
#define pb              push_back
#define fi              first
#define se              second
#define mp              make_pair
#define mii             map<int,int>
#define pqb             priority_queue<int>   // Max Heap
#define pqs             priority_queue<int,vi,greater<int> >   // Min Heap
#define setbits(x)      __builtin_popcountll(x)   // returns the number of set bits in the binary representation of x
#define zrobits(x)      __builtin_ctzll(x)   // returns the number of zeroes before the first set bit in the binary representation of x
#define mod             1000000007   // 1e9 + 7
#define inf             1e18   // pow(10, 18)
#define mk(arr,n,type)  type *arr=new type[n];   // generates a dynamic array
#define w(x)            int x; cin>>x; while(x--)   // for taking test cases
mt19937                 rng(chrono::steady_clock::now().time_since_epoch().count());   // used with shuffle

// to be used with algorithms that processes a container Eg: find(all(c),42)
#define all(x) (x).begin(), (x).end() //Forward traversal
#define rall(x) (x).rbegin, (x).rend() //reverse traversal

// traversal function to avoid long template definition. Now with C++11 auto alleviates the pain.
#define tr(c,i) for(__typeof__((c)).begin() i = (c).begin(); i != (c).end(); i++)

// find if a given value is present in a container. Container version. Runs in log(n) for set and map
#define present(c,x) ((c).find(x) != (c).end())

//find version works for all containers. This is present in std namespace.
#define cpresent(c,x) (find(all(c),x) != (c).end())

// Avoiding wrap around of size()-1 where size is a unsigned int.
#define sz(a) int((a).size())

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;   // Used to implement policy-based data structure

// Shorthand for commonly used types
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef double ld;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.precision(10);
    cout << fixed;

    int n;
    cin>>n;
    vector<ll> nums(n);
    for0(i, n)
       cin>>nums[i];

    vi ans(n);
    for(int i = 0; i < n; i++){

        ll temp = 1;
        for(int j = 1; j <= 6; j++){
        	if((nums[i]+j)%7 == 0){
        		temp = (nums[i]+j)/7;
        		temp--;
        		break;
        	}
        }

        if(temp%2 == 0)
           ans[i] = 1;
    }

    for(int l: ans){
    	if(l)
    		cout<<"YES\n";
    	else
    		cout<<"NO\n";
    }

    return 0;
}


#include <bits/stdc++.h>  // This will work only for g++ compiler.
#include <ext/pb_ds/assoc_container.hpp> // Used to include policy based data structure
using namespace __gnu_pbds;  // Only for g++ compiler
using namespace std;

#define for0(i, n) for (int i = 0; i < (int)(n); ++i) // 0 based indexing
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i) // 1 based indexing
#define forc(i, l, r) for (int i = (int)(l); i <= (int)(r); ++i) // closed interver from l to r r inclusive
#define forr0(i, n) for (int i = (int)(n) - 1; i >= 0; --i) // reverse 0 based.
#define forr1(i, n) for (int i = (int)(n); i >= 1; --i) // reverse 1 based
#define max(a, b)  (a > b) ?a :b  // max of 2 elements
#define min(a, b)  (a < b) ?a :b  // min of 2 elements

//short hand for usual tokens
#define pb              push_back
#define fi              first
#define se              second
#define mp              make_pair
#define mii             map<int,int>
#define pqb             priority_queue<int>   // Max Heap
#define pqs             priority_queue<int,vi,greater<int> >   // Min Heap
#define setbits(x)      __builtin_popcountll(x)   // returns the number of set bits in the binary representation of x
#define zrobits(x)      __builtin_ctzll(x)   // returns the number of zeroes before the first set bit in the binary representation of x
#define mod             1000000007   // 1e9 + 7
#define inf             1e18   // pow(10, 18)
#define mk(arr,n,type)  type *arr=new type[n];   // generates a dynamic array
#define w(x)            int x; cin>>x; while(x--)   // for taking test cases
mt19937                 rng(chrono::steady_clock::now().time_since_epoch().count());   // used with shuffle

// to be used with algorithms that processes a container Eg: find(all(c),42)
#define all(x) (x).begin(), (x).end() //Forward traversal
#define rall(x) (x).rbegin, (x).rend() //reverse traversal

// traversal function to avoid long template definition. Now with C++11 auto alleviates the pain.
#define tr(c,i) for(__typeof__((c)).begin() i = (c).begin(); i != (c).end(); i++)

// find if a given value is present in a container. Container version. Runs in log(n) for set and map
#define present(c,x) ((c).find(x) != (c).end())

//find version works for all containers. This is present in std namespace.
#define cpresent(c,x) (find(all(c),x) != (c).end())

// Avoiding wrap around of size()-1 where size is a unsigned int.
#define sz(a) int((a).size())

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;   // Used to implement policy-based data structure

// Shorthand for commonly used types
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef double ld;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.precision(10);
    cout << fixed;

    int n;
    cin>>n;
    while(n--){
    	ll x;
    	cin>>x;
    	ll numDie = x/21 + 1;
    	ll totSum = numDie*21;
    	if(numDie > 1){
            totSum -= (numDie-1)*7 ;
            numDie = 1;
    	}

        int flag = 0;
        for(int i = 1; i <= 6; i++){
        	if((totSum-i) == x)
        		flag = 1;
        }

        if(flag)
        	cout<<"YES\n";
        else
        	cout<<"NO\n";

    }
    return 0;
}