#include #include #include #include #include #define F first #define S second #define MP make_pair using namespace std; typedef long long ll; const ll MN = 1e6+100; const int N = (1<<23)-1; int a[MN]; ll ha = 98765431; ll sumA2[MN]; bool arr[N]; int main() { int t; scanf("%d ", &t); for(int xx = 1; xx <= t; ++xx) { memset(arr, 0, sizeof arr); //cout<<"Case #"<>n>>k; scanf("%d %d ", &n, &k); vector > sumA(n+1); for(ll i = 0; i < n; ++i) { // cin>>a[i]; scanf(" %d", &a[i]); if(i&1) a[i] = -a[i]; sumA[i+1] = MP(sumA[i].F + a[i], i); sumA2[i+1] = sumA2[i] + a[i]; } sort(sumA.begin(), sumA.end()); //lol.insert(sumA[n]); arr[(sumA2[n]*ha)&N] = 1; for(ll i = n-1; i >= 0; --i) { arr[(sumA2[i]*ha)&N] = 1; if(i&1) { if(arr[((-k+sumA2[i])*ha)&N]) { vector >::iterator x = lower_bound(sumA.begin(), sumA.end(), MP(-k+sumA2[i], i)); if(x != sumA.end() && x->F == -k+sumA2[i]) { printf("Case #%d: Yes.\n", xx); goto ohi; } } } else { if(arr[((k+sumA2[i])*ha)&N]) { vector >::iterator x = lower_bound(sumA.begin(), sumA.end(), MP(k+sumA2[i], i)); if(x != sumA.end() && x->F == k+sumA2[i]) { printf("Case #%d: Yes.\n", xx); goto ohi; } } } } printf("Case #%d: No.\n", xx); ohi:; } }