#define _GLIBCXX_DEBUG #import using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define REP(i, n) for (int i = 1; i < (int)(n); i++) typedef long long ll; #pragma GCC target("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #define updiv(N,X) (N + X - 1) / X #define l(n) n.begin(),n.end() #define YesNo(Q) Q==1?cout<<"Yes":cout<<"No" const int MOD = 998244353LL; vector fact, fact_inv, inv; /* init_nCk :二項係数のための前処理 計算量:O(n) */ void init_nCk(int SIZE) { fact.resize(SIZE + 5); fact_inv.resize(SIZE + 5); inv.resize(SIZE + 5); fact[0] = fact[1] = 1; fact_inv[0] = fact_inv[1] = 1; inv[1] = 1; for (int i = 2; i < SIZE + 5; i++) { fact[i] = fact[i - 1] * i % MOD; inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD; fact_inv[i] = fact_inv[i - 1] * inv[i] % MOD; } } /* nCk :MODでの二項係数を求める(前処理 int_nCk が必要) 計算量:O(1) */ long long nCk(int n, int k) { assert(!(n < k)); assert(!(n < 0 || k < 0)); return fact[n] * (fact_inv[k] * fact_inv[n - k] % MOD) % MOD; } long long modpow(long long a, long long n, long long mod) { long long res = 1; while (n > 0) { if (n & 1) res = res * a % mod; a = a * a % mod; n >>= 1; } return res; } int main() { int t;cin>>t; rep(i,t){ int n,m;cin>>n>>m; int a[2][n]; rep(i,n){cin >> a[0][i];} bool dekiru = true; a[1][0]=m - a[0][0]; for(int j=1;ja[0][j]){dekiru = false;} a[1][j] = a[0][j-1]-(a[0][j]-a[1][j-1]); } YesNo(dekiru);cout << endl; } }