#include <iostream>
#include <cstdio>
using namespace std;

int main() {
	// your code goes here
	int t, k, a, b, flag;
	scanf("%d", &t);
	while(t--) {
		scanf("%d", &k);
		b=1; flag=0;
		while(k--) {
			scanf("%d", &a); if(a>b) {
				flag++; break;
			} b=(b-a)*2;
		}
		if(flag || b) printf("No\n");
		else printf("Yes\n");
	}
	return 0;
}