import java.math.BigInteger;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scanner=new Scanner(System.in);
		int t=scanner.nextInt();
		int a[]= {1,4,7,9,10,12,13};
		O1:for (int i = 0; i < t; i++) {
			BigInteger xBigInteger=new BigInteger(scanner.next());
			if(xBigInteger.compareTo(new BigInteger("14"))>0) {
				System.out.println("Yes");
				continue;
			}else {
				for (int j = 0; j < a.length; j++) {
					if(xBigInteger.equals(new BigInteger(""+a[j]))) {
						System.out.println("Yes");
						continue O1;
					}
				}
			}
			System.out.println("No");
				//1 4 7 10 13 16 19
				//1 9 17 25 33 41 49
				//1 9 12 15
				//15 16 17
				//所以15之后的所有数,就是可以的,现在就是要看看15之前能不能满足条件
				//1 4 7 10 13
				//1 9 12
				//1 4 7 9 10 12 13
		}

	}

}

这题纯数学规律,没找出来就做不了