#include using namespace std; //#include //using namespace atcoder; typedef long long ll; typedef unsigned long long ull; const int MAX = 1e9; const int MIN = -1*1e9; const ll MAXLL = 1e18; const ll MINLL = -1*1e18; //const ll MOD = 998244353; //const ll MOD = 1000000007; int main() { int Q; cin >> Q; for(int q = 0; q < Q; q++) { int A,B; cin >> A >> B; if(A == 0 && B == 1) { cout << "Yes" << endl; cout << 0 << " " << 0 << endl; continue; } if(B > 4*A) { cout << "No" << endl; continue; } cout << "Yes" << endl; if(B <= 4*(A-1)) cout << 1 << " " << A-1 << endl; else cout << 0 << " " << A << endl; } return 0; }