#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define fastIO ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long int
#define pb push_back
#define ff first
#define ss second
#define all(v) (v).begin(), (v).end()
#define mod (int)(998244353)
#define PI 3.14159265358979323846264338327950L
// ------------------ Debugging ------------------
#define trace(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args);cout << endl; }
void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
    cerr << "[ " << *it << " = " << a << " ] ";
    err(++it, args...);
}

template <typename Tk, typename Tv> ostream& operator<<(ostream& os, const pair<Tk, Tv> &p){os << "{" << p.first << ',' << p.second << "}";return os;}
template <typename T> ostream& operator<<(ostream& os, const vector<T> &p){os << "[ "; for (T x: p) os << x << " "; os << "]" << endl; return os;}
template <typename T> ostream& operator<<(ostream& os, const set<T> &p){os << "{ "; for (T x: p) os << x << " "; os << "}" << endl; return os;}
template <typename Tk, typename Tv> ostream& operator<<(ostream& os, const map<Tk, Tv> &p){os << "{ "; for (pair<Tk, Tv> x: p) os << x << " "; os << "}" << endl; return os;}

#define imie(args) cout << #args << ": "; cout << args;
// -----------------------------------------------

signed main(){

    fastIO

    int t = 1, tt = 0;;
    cin >> t;
    while (t--){
    	tt++;
   		int n;
   		cin >> n;
   		vector<int> v(n);
   		for (int &i : v) {
   			cin >> i;
   		}
   		// if (tt == 252) {
   		// 	cout << "-";
   		// 	for (int &i : v) {
   		// 		cout << i << "-";
   		// 	}
   		// 	cout << endl;
   		// 	continue;
   		// }
   		vector<int> chkf = v;
   		for (int i = 0; i < n-1; i++) {
   			int mn_to_sub = min(chkf[i], chkf[i+1]);
   			chkf[i] -= mn_to_sub;
   			chkf[i+1] -= mn_to_sub;
   		}
   		if (accumulate(chkf.begin(), chkf.end(), 0) == 0) {
   			cout << "YES\n";
   			continue;
   		}
   		vector<int> left(n), right(n);
   		left = v, right = v;
   		bool stop = 0;
   		for (int i = 1; i < n; i++) {
   			if (left[i-1] > left[i] || stop) {
   				// left[i-1] = -1;
   				left[i] = -1;
   				stop = 1;
   			} else 
   				left[i] -= left[i-1];
   		}
   		stop = 0;
   		for (int i = n-2; i >= 0; i--) {
   			if (right[i+1] > right[i] || stop) {
   				// right[i+1] = -1;
   				right[i] = -1;
   				stop = 1;
   			} else
   				right[i] -= right[i+1];
   		}
   		// imie(left);
   		// imie(right);
   		bool pass = false;
   		// swap(i, i-1) check for left[i-2], i, i-1, right[i+1] 
   		for (int i = 1; i < n; i++) {
   			int l_sum = 0, r_sum = 0;
   			if (i-2 >= 0) {
   				l_sum = left[i-2];
   			}
   			if (i+1 < n) {
   				r_sum = right[i+1];
   			}
   			// trace(i, v[i-1], v[i], l_sum, r_sum);
  			if (l_sum >= 0 && r_sum >= 0) {
  				if (l_sum <= v[i] && v[i]-l_sum <= v[i-1] && (v[i-1] - (v[i]-l_sum)) == r_sum) {
  					pass = true;
  					break;
  				}
  			}
		}
		cout << (pass ? "YES" : "NO" ) << endl;   		
    }
    
    return 0;
}