#include using namespace std; using ll = long long; template istream& operator >> (istream& is, vector& vec) { for(T& x : vec) is >> x; return is; } bool solve(){ int n, k, x; cin >> n >> k >> x; vector h(n); cin >> h; int g = 0; for(int i = 0; i + 1 < n; i++){ g = gcd(g, abs(h[i + 1] - h[i])); } return g % x == 0; } int main(){ ios::sync_with_stdio(false); cin.tie(0); int T; cin >> T; while(T--) cout << (solve() ? "Yes" : "No") << '\n'; }