#include
using namespace std;
int main()
{
int a,n,r,b,i,odd=0,even=0;
cin>>b;
for(i=1;i<=b;i++)
{
cin>>a;
while(a>0)
{
r=a%10;
a=a/10;
if (r%2==0)
{even=r+even;}
else{odd=r+odd;}
}
if (even%4==0 || odd%3==0)
{ cout<<"Yes"<<endl;}
else cout<<"No"<<endl;
}
return 0;
}