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

using ll=long long;
using ull=unsigned long long;
using i128=__int128_t;
using u128=__uint128_t;
using ld=long double;

void solve()
{
	ll x,y,a,b,c,d;//裴蜀定理的延申 可以去学习一下
	cin >> x >> y >> a >> b >> c >> d;//对于方程ax+by=c的整数解 当且仅当 gcd(a,b)|c时成立 根据题意列出两个二元一次方程 判断是否有解即可 注意x,y是坐标 不是数组下标 别弄混了
	if(y%gcd(a,b)==0&&x%gcd(c,d)==0) cout << "YES" << "\n";
	else cout << "NO" << "\n";
}

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	
	int t=1;
	cin >> t;
	
	while(t--)
	{
		solve();
	}
	return 0;
}