// Arup Guha
// 1/24/2015
// Solution to 2005 MCPC Problem C: Connect

import java.util.*;

public class c {

	final public static double EPSILON = 1e-9;

	public static void main(String[] args) {

		Scanner stdin = new Scanner(System.in);
		int n = stdin.nextInt();
		int moves = stdin.nextInt();

		// Go through all cases.
		while (n != 0) {

			// Read in all the moves.
			pt2D[] black = new pt2D[moves/2+1];
			pt2D[] white = new pt2D[moves/2];
			for(int i=0; i<moves; i+=2) {
				int x = stdin.nextInt();
				int y = stdin.nextInt();
				black[i/2] = new pt2D(x,y);
				if (i+1 == moves) break;
				x = stdin.nextInt();
				y = stdin.nextInt();
				white[i/2] = new pt2D(x,y);
			}

			// Solve it!
			System.out.println(solve(black, white, n));

			// Get next set case.
			n = stdin.nextInt();
			moves = stdin.nextInt();
		}
	}

	// Returns "yes" if black wins, "no" otherwise.
	public static String solve(pt2D[] black, pt2D[] white, int n) {

		// Set up graphs.
		ArrayList[] bGraph = new ArrayList[black.length];
		ArrayList[] wGraph = new ArrayList[white.length];
		for (int i=0; i<bGraph.length; i++)
			bGraph[i] = new ArrayList<Integer>();
		for (int i=0; i<wGraph.length; i++)
			wGraph[i] = new ArrayList<Integer>();

		// Go through all the moves.
		for (int i=1; i<black.length; i++) {
			update(bGraph, wGraph, i, black, white);
			if (i == white.length) break;
			update(wGraph, bGraph, i, white, black);
		}

		// Try to find winning path starting from left end.
		for (int i=0; i<bGraph.length; i++) {
			if (Math.abs(black[i].x) < EPSILON) {

				// Do a DFS from this node.
				boolean[] reached = new boolean[black.length];
				dfs(bGraph, i, reached);
				for (int j=0; j<bGraph.length; j++)
					if (reached[j] && Math.abs(black[j].x-n) < EPSILON)
						return "yes";
			}
		}

		// Never worked.
		return "no";
	}

	public static void dfs(ArrayList[] graph, int node, boolean[] reached) {

		// Mark it.
		reached[node] = true;

		// Go to all unvisited neighbors.
		for (int i=0; i<graph[node].size(); i++)
			if (!reached[(Integer)graph[node].get(i)])
				dfs(graph, (Integer)graph[node].get(i), reached);
	}

	public static void update(ArrayList[] myGraph, ArrayList[] theirGraph, int node, pt2D[] myMoves, pt2D[] theirMoves) {

		// Consider connecting node to i in myGraph.
		for (int i=0; i<node; i++) {

			// Not a knight move.
			if (!myMoves[i].knight(myMoves[node])) continue;

			// Segment we might add.
			line tmp = new line(myMoves[node], myMoves[i]);

			// Segment intersection detection - must try both.
			if (doesCross(tmp, myGraph, myMoves)) continue;
			if (doesCross(tmp, theirGraph, theirMoves)) continue;

			// Add this edge to the graph.
			myGraph[i].add(node);
			myGraph[node].add(i);
		}
	}

	public static boolean doesCross(line tmp, ArrayList[] graph, pt2D[] moves) {

		// Loops through all edges in graph.
		for (int j=0; j<graph.length; j++) {
			for (int k=0; k<graph[j].size(); k++) {
				line other = new line(moves[j], moves[(Integer)graph[j].get(k)]);
				pt2D cross = tmp.intersect(other);

				// Must intersect at a non-lattice point.
				if (cross != null && !cross.isLattice())
					return true;
			}
		}

		// No intersection detected.
		return false;
	}
}

/*** 2d line segment intersection code from here down... ***/
class vect2D {

    public double x;
    public double y;

    public vect2D(double myx, double myy) {
        x = myx;
        y = myy;
    }

    public vect2D(pt2D start, pt2D end) {
        x = end.x - start.x;
        y = end.y - start.y;
    }

    public double dot(vect2D other) {
        return this.x*other.x + this.y*other.y;
    }

    public double mag() {
        return Math.sqrt(x*x+y*y);
    }

    // This formula comes from using the relationship between the dot product and
    // the cosine of the included angle.
    public double angle(vect2D other) {
        return Math.acos(this.dot(other)/mag()/other.mag());
    }

    public double signedCrossMag(vect2D other) {
        return this.x*other.y-other.x*this.y;
    }

    public double crossMag(vect2D other) {
        return Math.abs(signedCrossMag(other));
    }
}

// Modified to do segment.
class line {

    final public static double EPSILON = 1e-9;

    public pt2D p;
    public vect2D dir;

    public line(pt2D start, pt2D end) {
        p = start;
        dir = new vect2D(start, end);
    }

    public pt2D intersect(line other) {

        // This is the denominator we get when setting up our system of equations for
        // our two parametric line parameters.
        double den = det(dir.x, -other.dir.x, dir.y, -other.dir.y);
        if (Math.abs(den) < EPSILON) return null;

        // We already have the denominator, now solve for the numerator for lambda, the
        // parameter for this line. Then return the resultant point.
        double numLambda = det(other.p.x-p.x, -other.dir.x, other.p.y-p.y, -other.dir.y);

        // Other parameter for line.
        double numBeta = det(dir.x, other.p.x-p.x,dir.y, other.p.y-p.y);

        if (0 <= numLambda/den && numLambda/den <= 1)
        	if (0 <= numBeta/den && numBeta/den <= 1)
        		return eval(numLambda/den);

    	// No intersection.
    	return null;
    }

    // Returns the shortest distance from other to this line. Sets a vector from the starting
    // point of this line to other and uses the cross product with that vector and the direction
    // vector of the line.
    public double distance(pt2D other) {
        vect2D toPt = new vect2D(p, other);
        return dir.crossMag(toPt)/dir.mag();
    }

    // Returns the point on this line corresponding to parameter lambda.
    public pt2D eval(double lambda) {
        return new pt2D(p.x+lambda*dir.x, p.y+lambda*dir.y);
    }

    public static double det(double a, double b, double c, double d) {
        return a*d - b*c;
    }
}

class pt2D {

	final public static double EPSILON = 1e-9;

    public double x;
    public double y;

    public pt2D(double myx, double myy) {
        x = myx;
        y = myy;
    }

    // Returns true iff it's a knight move from this to other.
    public boolean knight(pt2D other) {
    	double[] diff = new double[2];
    	diff[0] = Math.abs(x - other.x);
    	diff[1] = Math.abs(y - other.y);
    	Arrays.sort(diff);
    	return Math.abs(diff[0]-1) < EPSILON && Math.abs(diff[1]-2) < EPSILON;
    }

    // Returns true iff this point is a lattice point.
    public boolean isLattice() {
    	double[] left = new double[2];
    	left[0] = x - (int)x;
    	left[1] = y - (int)y;
    	return left[0] < EPSILON && left[1] < EPSILON;
    }
}