import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner in=new Scanner(System.in);
long n=in.nextLong();
long p;
int sum=0;
for(p=1;p<=n;p++)
{
sum=0;
int temp=in.nextInt();
while(temp!=0)
{
sum=sum+temp%10;
temp=temp/10;
}
if((sum%2==0&&sum%4==0)||(sum%2!=0&&sum%3==0))
{
System.out.println(“Yes”);
}
else
System.out.println(“No”);
}
}
}