#include <bits/stdc++.h>
using namespace std;

#define int long long
const int INF=1e16;
const int maxn=2e5+10;
int a[maxn];
int pre[maxn];
int suf[maxn];

bool check(int x1,int x2,int x3,int x4)
{
    x2=x2-x1;
    x3=x3-x2;
    x4=x4-x3;
    
    if(x2<0 || x3<0 || x4!=0)
      return 0;
      
      return 1;
}

signed main()
{
   
    int t;    
    cin>>t;    
    while(t--)
    {
       int n;
       cin>>n;
       
       for(int i=1;i<=n;i++)
          cin>>a[i];
          
       pre[0]=0;
       for(int i=1;i<=n;i++)
       {
           pre[i]=a[i]-pre[i-1];
           if(pre[i]<0)
           pre[i]=INF;
       }
       suf[n+1]=0;
       
       for(int i=n;i>=1;i--)
       {
           suf[i] = a[i]-suf[i+1];
           
           if(suf[i]<0)
           suf[i]=INF;
       }
       
       int ans=0;
       if(pre[n]==0)
        ans=1;
        
       for(int i=1;i<=n-1;i++)
       {
           if(pre[i-1]==INF || suf[i+2]==INF)
            continue;
            
           if(check(pre[i-1],a[i+1],a[i],suf[i+2]))
           {
               ans=1;
           }
       }
       
       if(ans==1)
         cout<<"YES"<<'\n';
      else
         cout<<"NO"<<'\n';
    }     
   
        
        
    return 0;
}