#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using ii = pair<int,int>;

#define ff first
#define se second
#define pb push_back
#define all(x) (x).begin(),(x).end()

const int mod = 1e9+7;
const int inf = 1e9;
const int mx  = 1e6+5;

#define exitYes {cout<<"Yes\n"; return;}
#define exitNo  {cout<<"No\n";  return;}

bool can(vector<ll> a){
    for(int i=1; i<a.size(); i++){
        if(a[i-1] > a[i]) return false;
        a[i] -= a[i-1]; a[i-1] = 0;
    }return (a.back() == 0);
}

void solve(int cs){
//    cout << "Case " << cs << ": ";
    int n; cin >> n;
    vector<ll> v(n);
    for(auto &u:v) cin >> u;

    if(can(v)) exitYes
    if(n == 1) exitNo

    swap(v[0], v[1]);       if(can(v)) exitYes swap(v[0],v[1]);
    swap(v[n-1], v[n-2]);   if(can(v)) exitYes swap(v[n-1], v[n-2]);

    vector<ll> p(n), s(n), b = v;

    p[0] = b[0];
    for(int i=1; i<n; i++){
        if(p[i-1]==-1 || b[i-1]>b[i]) p[i]=-1;
        else b[i]-=b[i-1], b[i-1]=0, p[i]=b[i];
    }b = v;

    s[n-1] = b[n-1];
    for(int i=n-2; i>=0; i--){
        if(s[i+1]==-1 || b[i+1]>b[i]) s[i]=-1;
        else b[i]-=b[i+1], b[i+1]=0, s[i]=b[i];
    }

    for(int i=1; i+2<n; i++){
        if(p[i-1] == -1 || s[i+2]==-1) continue;
        vector<ll> c = {p[i-1], v[i], v[i+1], s[i+2]};
        swap(c[1], c[2]); if(can(c)) exitYes
    }exitNo
}

int main(){

    ios_base::sync_with_stdio(false);
    cin.tie(nullptr); cout.tie(nullptr);

    int tc = 1, cs = 1;
    cin >> tc;
    while(tc--) solve(cs++);

    return 0;
}

