#define _USE_MATH_DEFINES

#include <iostream>
#include <fstream>
#include <vector>
#include <cmath>
#include <cassert>

using namespace std;

const double EPS = 0.000001;

void generate2tests()
{
	// test 1. Just a big test.
	ofstream test("test.out");
	test <<100 <<endl <<100 <<endl;
	srand(787887887);
	vector<vector<bool> > pconst(101, vector<bool>(101, 0));
	vector<vector<bool> > p = pconst;
	for (int i = 0;i < 100;i++)
	{
		int x, y;
		do
		{
			x = 1 + (rand() % 99);
			y = 1 + (rand() % 99);
		}
		while (p[x][y]);

		p[x][y]=true;
		test << x <<" " <<y <<" ";
	}

	test <<endl <<100 <<endl <<100 <<endl;
	srand(787887655);
	p = pconst;
	for (int i = 0;i < 100;i++)
	{
		int x, y;
		do
		{
			x = 1 + (rand() % 49);
			y = 1 + (rand() % 99);
		}
		while (p[x][y]);

		p[x][y]=true;
		test << x <<" " <<y <<" ";
	}
}


double hyp(double x, double y)
{
	return sqrt(x*x + y*y);
}

// only collinear vectors must be passed here
bool opposite(double x1, double y1, double x2, double y2)
{
	double sum_len = hyp(x1 + x2, y1 + y2);
	if (fabs(sum_len - (hyp(x1, y1) + hyp(x2, y2))) < EPS)
		return false;
	return true;
}

// In the solution we are trying to build a division
// vector that will go through center point and every other points.
// For each possible division vector, one should check whether
// other points are from one hand from this vector or not.
int main()
{
	ifstream in("division.in");

	int tc;
	in >>tc;
	while (tc--)
	{
		int N, M;
		vector<double> X, Y;			

		in >>N >>M;

		vector<vector<bool> > points(N + 1, vector<bool>(N + 1, false));

		assert(N > 1 && N <= 100);
		assert(M > 0 && M <= 100);

		X.assign(M, 0);
		Y.assign(M, 0);

		double xc, yc;
		xc = yc = N * 0.5;

		bool has_center_point = false;
		for (int i = 0;i < M;i++)
		{
			in >>X[i] >>Y[i];
			assert(X[i] > 0 && X[i] < N);
			assert(Y[i] > 0 && Y[i] < N);
			assert(points[X[i]][Y[i]] == false);
			points[X[i]][Y[i]] = true;
			X[i] -= xc;
			Y[i] -= yc;

			if (fabs(X[i]) < EPS && fabs(Y[i]) < EPS)
				has_center_point = true;
		}

		bool ok = false;
		if (!has_center_point)
			for (int i = 0;i < M;i++)
			{
				// division vector
				double x1, y1;
				x1 = X[i];
				y1 = Y[i];
				int sign = 0;

				bool division = true;
				for (int j = 0;j < M;j++)
				{	
					if (i == j) 
						continue;
					double x2, y2;
					x2 = X[j];
					y2 = Y[j];

					double cross = x1*y2 - x2*y1;

					if ((fabs(cross) < EPS && opposite(x1, y1, x2, y2)) || (cross > 0 && sign < 0) || (cross < 0 && sign > 0))
					{
						division = false;
						break;
					}
					if (sign == 0)
						sign = cross > 0 ? 1 : -1;
				}
				if (division)
				{
					ok = true;
					break;
				}
			}
		cout <<(ok ? "YES" : "NO") <<endl;
	}

	return 0;
}
