#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define ini(a,i) memset(a,i,sizeof(a))
#define pb push_back
#define int int64_t
#define inf LLONG_MAX


void solve()
{
    int n;
    cin>>n;

    int a[n+5],pref[n+5],suff[n+5];
    ini(a,0);ini(pref,0);ini(suff,0);

    for(int i=1;i<=n;i++)    
        cin>>a[i];


    for(int i=1;i<=n;i++)
    {
        if(pref[i-1] > a[i])
            pref[i]=inf;
        else
            pref[i]=a[i]-pref[i-1];
    }

    for(int i=n;i>0;i--)
    {
        if(suff[i+1] > a[i])
            suff[i]=inf;
        else
            suff[i]=a[i]-suff[i+1];
    }

    
    if(pref[n] == 0 or suff[1]==0)
    {
        cout<<"YES"<<endl;
        return;
    }


    for(int i=1;i<n;i++)
    {
        if((pref[i] != inf and pref[i]==suff[i+1]) or (pref[i-1] <= a[i+1] and suff[i+2] <= a[i] and (a[i+1]-pref[i-1] == a[i]-suff[i+2])))
        {
            cout<<"YES"<<endl;
            return;
        }
    }

    cout<<"NO"<<endl;
}


signed main()
{
    std::ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    int tt;    cin>>tt;    while(tt--)
        solve();
     
    cerr<<" Execution : "<<(1.0*clock())/CLOCKS_PER_SEC<<"s \n";
        
        
return 0;
}