#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define pii pair<int,int>
#define pll pair<ll,ll>
#define MP make_pair
#define FF first
#define SS second
#define all(x) (x).begin(), (x).end()
#define mem(a,n) memset(a,n,sizeof(a))
#define IOS ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
priority_queue <int,vector<int>,less<int> > QM;
const int INF= 0x3f3f3f3f;
const int maxn= 2e5+5;

int n,L[maxn],R[maxn]; 
bool check(vector<int> Q)
{
	for(int i=1;i<Q.size();i++)
	{
		if(Q[i] < Q[i-1])	return 0;
		Q[i] -= Q[i-1];
	}
	return Q.back()==0;
}
void solve()
{
	cin>>n;
	vector<int> a(n+5,0),b(n+5,0);
	for(int i=1;i<=n;i++)	cin>>a[i], b[i]=a[i];
	for(int i=1;i<=n;i++)	L[i] = R[i] = -INF;//初始化 	
	//初判 
	if(check(a))	{cout<<"YES"<<endl; return ;}
	//首判 
	swap(a[1],a[2]);
	if(check(a))	{cout<<"YES"<<endl; return ;}
	swap(a[1],a[2]);
	//尾判 
	swap(a[n-1],a[n]);
	if(check(a))	{cout<<"YES"<<endl; return ;}
	swap(a[n-1],a[n]);
		
	for(int i=1;i<=n;i++)//左
	{
		if(b[i] < b[i-1])	break;
		else	L[i] = b[i]-=b[i-1];
	}
	
	for(int i=1;i<=n;i++)	b[i]=a[i];
	
	for(int i=n;i>=1;i--)//右
	{
		if(b[i] < b[i+1])	break;
		else	R[i] = b[i]-=b[i+1];
	}
	
	bool flag=0;
	//交换a[i],a[i+1]
	for(int i=2;i<=n-2;i++)
	{
		if(L[i-1]==-INF || R[i+2]==-INF)	continue;
		vector<int> P = {L[i-1],a[i+1],a[i],R[i+2]};
		if(check(P))
		{
			flag=1;
			break;
		}
	}
	if(flag)	cout<<"YES"<<endl;
	else		cout<<"NO"<<endl;
}
int main()
{
	IOS;
	int t;cin>>t;
	while(t--){ solve(); }
	return 0;
}
