Help me in solving CSCV210A problem

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

My code

// The code below is incorrect. Debug the code to solve this problem
#include <bits/stdc++.h>
using namespace std;

int main() 
{
  int t;
  cin>>t;
  while(t--)
   {
    int X,Y;
    //Accept 2 integers inputs.
    cin>>X>>Y;       
    
    if (X == Y)         
    cout<<"YES"<<endl;
    else
    if(X != Y)
    cout<<"NO"<<endl;
   }
 return 0;
}

My issue

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

int main()
{
int t;
cin>>t;
while(t–)
{
int X,Y;
//Accept 2 integers inputs.
cin>>X>>Y;

if (X>0 && Y>0 && X == Y)  // Both X and Y should be equal and greater than zero as 
                                                //mentioned in the question         
cout<<"YES"<<endl;
else
cout<<"NO"<<endl;

}
return 0;
}