#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define mp make_pair
#define fi first
#define se second
#define io ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define pb push_back
#define all(x) (x).begin(),(x).end()
#define pii pair<ll,ll>
ll gcd(ll a,ll b){if(b==0)return a;else return gcd(b,a%b);}
int main(){
	io;
	int t;
	cin>>t;
	while(t--){
		int n;
		cin>>n;
		int l[n];
		int r[n];
		int a[n];
		for(int i=0;i<n;i++){
			cin>>a[i];
		}
		if(n==2){
			if(a[0]==a[1]){
				cout<<"YES"<<endl;
			}
			else{
				cout<<"NO"<<endl;
			}
			continue;
		}
		int ml=n,mr=-1;
		for(int i=0;i<n;i++){
			l[i]=a[i];
			if(i){
				l[i]=l[i]-l[i-1];
			}
			if(l[i]<0){
				ml=min(ml,i);
			}
		}
		for(int i=n-1;i>=0;i--){
			r[i]=a[i];
			if(i<(n-1))
			r[i]=r[i]-r[i+1];
			if(r[i]<0){
				mr=max(mr,i);
			}
		}
		if(ml==n && l[n-1]==0){
			cout<<"YES"<<endl;
		}
		else{
			int u=0;
			for(int i=1;i<n;i++){
				int x1=0,x2=0;
				if((i+1)<n)
				x1=r[i+1];
				if((i-2)>=0)
				x2=l[i-2];
				if(mr<=i && ml>(i-2) && a[i]>=x2 && a[i-1]>=x1 && (a[i]-x2)==(a[i-1]-x1)){
					u=1;break;
				}
			}
			if(u){
				cout<<"YES"<<endl;
			}
			else{
				cout<<"NO"<<endl;
			}
		}
	}
	return 0;
}








