/*
	Author: Arjan Singh Bal, IIIT Gwalior
	"Everything in this world is magic, except to the magician"
*/

#include						<bits/stdc++.h>
#ifdef LOCAL
#include						"pprint.hpp"
#else
#define trace 					//
#endif

using namespace std;

template <typename Arg1>
void prn(Arg1&& arg1)
{ cout << arg1 << "\n"; }
template <typename Arg1, typename... Args>
void prn(Arg1&& arg1, Args&&... args)
{ cout << arg1 << " "; prn(args...); }

template <typename Arg1>
void prs(Arg1&& arg1)
{ cout << arg1 << " ";}
template <typename Arg1, typename... Args>
void prs(Arg1&& arg1, Args&&... args)
{ cout << arg1 << " "; prs(args...); }

template <typename Arg1>
void read(Arg1&& arg1)
{ cin >> arg1; }
template <typename Arg1, typename... Args>
void read(Arg1&& arg1, Args&&... args)
{ cin >> arg1; read(args...); }

#define ll						long long
#define pii						pair<int, int>
#define pli						pair<ll, int>
#define pil						pair<int, ll>
#define pll						pair<ll, ll>
#define vi						vector<int>
#define vll						vector<ll>
#define vb						vector<bool>
#define vd						vector<double>
#define vs						vector<string>
#define ff						first
#define ss						second
#define pb						push_back
#define eb						emplace_back
#define ppb						pop_back
#define pf						push_front
#define ppf						pop_front
#define vpii					vector<pii>
#define umap					unordered_map
#define all(x)					x.begin(),x.end()
#define clr(a,b)				memset(a,b,sizeof a)
#define fr(i, n)				for (int i = 0; i < n; ++i)
#define fr1(i, n)				for (int i = 1; i <= n; ++i)
#define rfr(i, n)				for (int i = n - 1; i >= 0; --i)
#define precise(x)				cout << fixed << setprecision(x)
typedef double					f80;

inline void solve();

signed main()
{
#ifdef LOCAL
	freopen("in.txt" , "r" , stdin);
	//freopen("out.txt" , "w" , stdout);
#else	
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
#endif
	
	int t = 1;
	read(t);
	fr1 (tc, t) {
		// cout << "Case #" << tc << ": ";
		solve();
	}
	return 0;
}

int n;

bool solve(vll &vec, vb & ans)
{
	ans.resize(n + 1);
	vll pre(n + 2, 0), badLeft = pre, suf = pre;

	auto checkLeft = [&](int i, ll prei) {
		if (i & 1) {
			if (prei < 0) return 1;
		} else {
			if (prei > 0) return 1;
		}
		return 0;
	};

	fr1 (i, n) {
		pre[i] = pre[i - 1];
		badLeft[i] = badLeft[i - 1];

		if (i & 1) {
			pre[i] += vec[i];
		}
		else {
			pre[i] -= vec[i];
		}
		badLeft[i] += checkLeft(i, pre[i]);
	}

	for (int i = n; i > 0; --i) {
		suf[i] = suf[i + 1];
		if (i & 1) suf[i] += vec[i];			
		else suf[i] -= vec[i];			
	}

	bool ret = 0;
	if (!badLeft[n] && pre[n] == 0) {
		ret = 1;
	}

	for (int i = 2; i <= n; ++i) {
		if (badLeft[i - 2]) continue;
		// trace(i);
		ll presum = pre[i - 2], sufsum = suf[i + 1];
		if (i & 1) {
			presum -= vec[i];
			sufsum += vec[i - 1];
		}
		else {
			presum += vec[i];
			sufsum -= vec[i - 1];
		}
		// trace(presum, sufsum);
		if (
			checkLeft(i - 1, presum) ||
			presum + sufsum != 0
		) continue;
		ans[i] = 1;	
	}
	return ret;
}

inline void solve()
{
	read(n);
	vll vec(n + 1);
	fr1 (i, n) {
		read(vec[i]);
	}

	vb a1, a2;
	bool aa1 = solve(vec, a1);
	reverse(vec.begin() + 1, vec.end());
	bool aa2 = solve(vec, a2);

	if (aa1 && aa2) {
		prn("YES");
		return ;
	}

	reverse(a2.begin() + 1, a2.end());

	for (int i = 2; i <= n; ++i) {
		if (a1[i] && a2[i - 1]) {
			trace(i);
			prn("YES");
			return ;
		}
	}

	prn("NO");
}
