import std.algorithm;
import std.conv;
import std.range;
import std.stdio;
import std.string;

void main ()
{
	auto tests = readln.strip.to !(int);
	foreach (test; 0..tests)
	{
		auto n = readln.strip.to !(int);
		auto a = readln.splitter.map !(to !(int)).array;
		int lo = int.max;
		int hi = 0;
		bool ok = true;
		foreach (i; 0..n)
		{
			lo = min (lo, a[i] - hi);
			hi = max (hi, a[i] - lo);
			ok &= (lo >= 0 && lo + hi == a[i]);
			debug {writeln (lo, " ", hi, " ", ok);}
		}
		writeln (ok ? "YES" : "NO");
	}
}
