Help me in solving BMCV2C09 problem

My issue

This is not a correct way of solving (solution given by CodeChef).
Can anyone give a general solution for this, which can also be useful for larger numbers.

My code

// Solution as follows

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

int main() 
{
	int t;
    cin >> t;
	
	while(t--)
	{
	    int N;
	    cin >> N;
	    if (N == 1 || N == 3 || N == 5)
	    {
	        cout << "No" << endl;
	    }
	    else
	    {
	        cout << "Yes" << endl;
	    }
	}
}

Learning course: C++ for problem solving - 2
Problem Link: CodeChef: Practical coding for everyone

int main()
{
int t;
cin >> t;

while(t--)
{
    int N;
    cin >> N;
       if(n%2==0)
        {
           cout<<"yes"<<endl;
       }
      else
          {
       cout<<"no"<<endl;
         }

}

The code is correct. You can put up values to cross check it.