#include<bits/stdc++.h>
#define fastio ios::sync_with_stdio(0);cin.tie(0);
#define rep1(i,n)	for(int (i)=1;(i)<=(n);(i)++)
#define rep0(i,n)	for(int (i)=0;(i)<n;(i)++)
#define rep(i,s,t) for(int i=(s);i<=(t);i++)
#define PI acos(-1)
#define VI vector<ll> 
#define PII pair<int,int>
#define SI set<int>
#define INF 0x3f3f3f3f33f3ff3f
#define ll long long
//#define int long long
#define mem(x,y) memset((x),(y),sizeof(x))
#define mp make_pair
using namespace std;
template <typename T>inline void read(T &x) {
	x = 0; int f = 1;
	char c = getchar();
	for (; !isdigit(c); c = getchar()) if (c == '-') f = -f;
	for (; isdigit(c); c = getchar()) x = x * 10 + c - '0';
	x *= f;
}
ll gcd(ll x,ll y){
	if(x<=y){
		ll t=x;
		x=y;
		y=t;
	}
	if(y==0)return x;
	else return gcd(y,x%y);
}
//
const int maxn=3e5+50;

//

//
ll n,k;
ll a[maxn];
void solve(){
	cin>>n>>k;
	cin>>a[0]>>a[1];
	ll g=abs(a[0]-a[1]);
	for (int i = 2; i < n; i++)
	{
		cin>>a[i];
		g=gcd(abs(a[i]-a[i-1]),g);
	}
	if((k-a[0])%g)cout<<"NO"<<endl;
	else cout<<"YES"<<endl;
}
int main(){
	fastio;
	int T;
	cin>>T;
	while(T--){
		solve();
	}
	//system("pause");
    return 0;
}
	  	 			 	    	   		 				 		 	