#include<bits/stdc++.h>
#define it register int
#define ct const int
#define il inline
using namespace std;
typedef long long ll;
#define rll register ll
#define cll const ll
#define mkp make_pair
#define fir first
#define sec second
#define P 998244353
namespace io{
	il char nc(){
		static char buf[100000],*p1=buf,*p2=buf;
		return p1==p2&&(p2=(p1=buf)+fread(buf,1,100000,stdin),p1==p2)?EOF:*p1++; 
	}
	template <class I> 
	il void fr(I &num){
		num=0;register char c=nc();it p=1;
		while(c<'0'||c>'9') c=='-'?p=-1,c=nc():c=nc();
		while(c>='0'&&c<='9') num=num*10+c-'0',c=nc();
		num*=p;
	}
	char obuf[1000001],*os=obuf, *ot = obuf + 1000001;
	il void flush(){fwrite(obuf,1,os-obuf,stdout),os=obuf;}
	il void putc(const char x){*os++=x,os==ot?flush():void();}
	template<class I>
	il void wr(I x){
		x<0?putc('-'),x=-x:0;
		static char qu[65];
		char *tmp=qu;
		do *tmp++=(x%10)^'0';while(x/=10);
		while(tmp--!=qu) putc(*tmp);
	}
	struct flusher{ ~flusher() { flush(); } }_;
}
using namespace io;
const int N=1000005;
template <class I>
il void ckMax(I&p,I q){p=(p>q?p:q);}
template <class I>
il void ckMin(I&p,I q){p=(p<q?p:q);}
int T,n,a[N],b[N],c[N];
int main(){ 
	scanf("%d",&T);it i;
	while(T--){
		scanf("%d",&n);rll sum=0;register bool fl=1;
		for(i=1;i<=n;++i) scanf("%d",&a[i]),sum+=a[i],b[i]=a[i];
		if(sum&1){puts("NO");continue;}
		for(i=2;i<=n;++i){
			if(b[i]<b[i-1]){fl=0;break;}
			b[i]-=b[i-1];
		}
		if(fl&&(!b[n])){puts("YES");continue;}
		for(i=1;i<=n;++i) b[i]=c[i]=a[i];fl=0;
		for(i=2;i<=n;++i) b[i]=(~b[i-1]?a[i]-b[i-1]:-1),b[i]<0?b[i]=-1:0;
		for(i=n-1;i;--i) c[i]=(~c[i+1]?a[i]-c[i+1]:-1),c[i]<0?c[i]=-1:0;
		for(i=1;i<n;++i) if((~b[i-1])&&(~c[i+2])&&b[i-1]<=a[i+1]&&c[i+2]<=a[i]&&a[i+1]-b[i-1]==a[i]-c[i+2]) fl=1,i=n+1;
		fl?puts("YES"):puts("NO");
	}
	return 0;
}
