#include
using namespace std;
int main()
{
int N;
cin>>N;
int rem;
int Car_no;
while(N >0)
{
cin>>Car_no;
int sum = 0;
while(Car_no>0)
{
rem=Car_no%10;
sum = sum + rem;
Car_no = Car_no /10;
}
if(sum%4==0 || sum%3==0)
{
cout<<"Yes";
cout<<endl;
}
else if(sum%4!=0 && sum%3!=0)
{
cout<<"No";
cout<<endl;
}
N = N-1;
}
return 0;
}