Help me in solving ALTERADD problem

My issue

test cases are not passing

My code

t=int(input())

for i in range(t):
    a,b=map(int,input().split())
    while a<b:
        if a%2!=0:
            a+=1
            if a==b:
                break
        
        elif a%2==0:
            a+=2
            print(a)
            if a==b:
                break
    
    if a==b:
        print("yes")
    else:
        print("no")
        
    

Problem Link: Alternate Additions Practice Coding Problem - CodeChef

@pavansaiduvvur
plzz refer the following code for better understanding of the logic

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

int main() {
	// your code goes here
	int t;
	cin>>t;
	while(t--)
	{
	    int a,b;
	    cin>>a>>b;
	    int d=(b-a)%3;
	    if(d==2)
	    cout<<"NO";
	    else 
	    cout<<"YES";
	    cout<<endl;
	}

}