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

#define pb push_back
#define all(a) begin(a), end(a)
#define deb(x) cout << #x << " = " << x << endl
#define debu(x, y) cout << "( " << #x << ", " << #y << " ) = ( " << x << ", " << y << " )" << endl

bool is_good(int a, int b, int c, int d) {
	if(a <= b && (b-a)<=c && (c+a-b) == d) return true;
	return false;
}

bool solve(vector<int> a) {
	int n = a.size();
	vector<int> s(n), p(n);
	s[n-1] = a[n-1];
	p[0] = a[0];
	for(int i=1; i<n; i++) {
		p[i] = a[i] - p[i-1];
		if(p[i-1] == -1) p[i] = -1;
		p[i] = max(p[i], -1);
	} 
	for(int i=n-2; i>=0; i--) {
		s[i] = a[i] - s[i+1];
		if(s[i+1] == -1) s[i] = -1;
		s[i] = max(s[i], -1);
	}
	//bool is = false;
	for(int i=0; i<n-1; i++) {
		int lef = (i>0?p[i-1]:0);
		int rig = (i+1<n-1?s[i+2]:0);
		if(lef == -1 || rig == -1) continue;
		bool sec = false;
		//debu(lef, rig);
		if(is_good(lef, a[i+1], a[i], rig) || is_good(lef, a[i], a[i+1], rig)) {
			return true;
		}
	}
	return false;
}

int main() {

#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif

	ios_base::sync_with_stdio(false);
	cin.tie(0);

	int tt = 1;
	cin >> tt;
	while(tt--) {
		int n;
		cin >> n;
		vector<int> a(n);
		for(int i=0; i<n; i++) {
			cin >> a[i];
		}

		bool ans = solve(a);
		
		if(ans) {
			cout << "YES" << "\n";
		} else {
			cout << "NO" << "\n";
		}
		
	}
	return 0;
}
	 	 	  		 	 	 	 				  		 				 	