/*
 *powered by caibiCH2
 *create at 2021-01-19 22:35:15
 */
#include <bits/stdc++.h>
#define elif else if
//#define max(x,y) ((x)>(y)?(x):(y))
//#define min(x,y) ((x)<(y)?(x):(y))
#define INF 0x3f3f3f3f
#define pb push_back
#define pf push_front
#define mp make_pair
typedef long long ll;
typedef unsigned long long ull;
using namespace std;

ll a[300010];

signed main(/*int argc, char const* argv[]*/) {
    std::ios::sync_with_stdio(false);
    //	std::cin.tie(0);
    int T;cin>>T;
    while(T--){
        int n;cin>>n;
        int p1=0,p2=0;
        for(int i=1;i<=n;++i){
            cin>>a[i];
            if(i&1)p1+=a[i];else p2+=a[i];
        }
        int flag=1;
        int now=0;
        for(int i=1;i<=n;++i){
            now=a[i]-now;
            if(now<0){flag=0;break;}
        }
        if(now!=0){flag=0;}
        if(flag){cout<<"YES\n";continue;}
        int maxl,minr;
        for(maxl=1,now=0;maxl<=n;++maxl){
            now=a[maxl]-now;
            if(now<0)break;
        }

        for(minr=n,now=0;minr>=1;--minr){
            now=a[minr]-now;
            if(now<0)break;
        }
//        clog<<maxl<<' '<<minr<<'\n';
        for(int i=1;i<n;++i){
            if(i>maxl||i+1<minr)continue;
            else{
                int t1,t2;
                if(i&1)t1=p1-a[i]+a[i+1],t2=p2-a[i+1]+a[i];
                else t1=p1+a[i]-a[i+1],t2=p2+a[i+1]-a[i];

                if(t1==t2){
                    now=0,flag=1;
                    swap(a[i],a[i+1]);
                    for(int j=1; j<=n; ++j){
                        now=a[j]-now;
                        if(now<0){flag=0;break;}
                    }
                    if(now!=0){flag=0;}
                    swap(a[i],a[i+1]);
                    if(flag==1)break;
                }
            }
        }
        cout<<(flag?"YES\n":"NO\n");
    }
    return 0;
}