#include #include #include #include #include #include #include #include #include #include using ll = long long; using namespace std; int main() { ll t, n, m, tmp; cin >> t; bool no = false; for (int i = 0; i < t; i++){ cin >> n >> m; vector a(n+1); a[0] = m; for (int j = 1; j <= n; j++){ cin >> tmp; if (a[j] > tmp){ no = true; } if (j != n){ a[j+1] += (a[j - 1] + a[j] - tmp); a[j] = tmp; } } if (no) { cout << "No" << "\n"; no = false; } else if (a[n-1] + a[n] == m) cout << "Yes" << endl; } }