import java.util.*;
import java.math.*;

import ru.ifmo.testlib.InStream;
import ru.ifmo.testlib.Outcome;
import static ru.ifmo.testlib.Outcome.Type.*;
import static ru.ifmo.testlib.Outcome.*;

public class Check implements ru.ifmo.testlib.Checker {

	final String YES = "Yes";
	final String NO = "No";
	final int MAX = 10000;

	@Override
	public Outcome test(InStream inf, InStream ouf, InStream ans) {
		String ja = ans.nextToken();
		String pa = ouf.nextToken();
		if (!pa.equals(YES) && !pa.equals(NO))
			quit(PE, YES + " or " + NO + " expected, " + pa + " found");
		if (pa.equals(NO)) {
			if (ja.equals(NO))
				quit(OK, NO);
			else
				quit(WA, ja + " expected, " + pa + " found");
		} else {
			// Check the solution
			int n = inf.nextInt();
			int m = inf.nextInt();
			int k = inf.nextInt();

			long[] x = new long[n];
			long[] y = new long[n];

			long[][] pc = new long[n][3];

			for (int i = 0; i < n; ++i) {
				x[i] = ouf.nextInt();
				y[i] = ouf.nextInt();
				if (Math.abs(x[i]) > MAX)
					quit(WA, "Out of bounds! (x[" + (i + 1) + "] = " + x[i] + ")");
				if (y[i] < -MAX || MAX < y[i])
					quit(WA, "Out of bounds! (y[" + (i + 1) + "] = " + y[i] + ")");
				for (int j = 0; j < i; ++j) {
					if (x[i] == x[j] && y[i] == y[j]) {
						quit(WA, "Points " + (i + 1) + " and " + (j + 1) + " coincide");
					}
				}
				pc[i] = new long[] { 1, x[i], y[i] };
			}

			// Checking for self-intersections and self-touchings.
			for (int i = 0; i < n; ++i) {
				int i1 = (i + 1) % n;
				{
					int i2 = (i + 2) % n;
					if ((x[i2] - x[i]) * (y[i1] - y[i]) == (x[i1] - x[i]) * (y[i2] - y[i]))
						quit(WA, "Vertex " + (i + 1) + " is invalid");
				}

				long[] li = vmul(pc[i], pc[i1]);

				for (int d = 2; d < n; ++d) {
					int j = (i + d) % n;
					if (smul(li, pc[j]) == 0) {
						if (between(x[i], x[j], x[i1]) &&
							between(y[i], y[j], y[i1])) {
							quit(WA, "Vertex " + (j + 1) + " is situated on edge (" + (i + 1) + ", " + (i1 + 1) + ")");
						}
					}
				}
				
				for (int d = 2; d < n - 1; ++d) {
					int j = (i + d) % n;
					int j1 = (j + 1) % n;
					long[] lj = vmul(pc[j], pc[j1]);
					if (Math.signum(smul(li, pc[j])) * Math.signum(smul(li, pc[j1])) < 0
							&& Math.signum(smul(lj, pc[i])) * Math.signum(smul(lj, pc[i1])) < 0) {
						quit(WA, "Edges (" + (i + 1) + ", " + (i1 + 1) + ") and (" + (j + 1) + ", " + (j1 + 1)
								+ ") cross");
					}
				}
			}

			int p1 = ouf.nextInt() - 1;
			if (p1 < 0 || n <= p1)
				quit(WA, "Number of first vertex is out of bounds: " + (p1 + 1));
			int p2 = ouf.nextInt() - 1;
			if (p2 < 0 || n <= p2)
				quit(WA, "Number of second vertex is out of bounds: " + (p2 + 1));

			long[] l = vmul(pc[p1], pc[p2]);

			ArrayList<Fraction> cp = new ArrayList<Fraction>();
			for (int i = 0; i < n; ++i) {
				int i1 = (i + 1) % n;
				if (Math.signum(smul(l, pc[i])) * Math.signum(smul(l, pc[i1])) <= 0) {
					long[] p = vmul(l, vmul(pc[i], pc[i1]));
					if (p[0] != 0) {
						Fraction px = new Fraction(p[1], p[0]);
						Fraction py = new Fraction(p[2], p[0]);
						cp.add((new Fraction(l[2], 1)).mul(px).sub((new Fraction(l[1], 1)).mul(py)));
					}
				}
			}

			Collections.sort(cp);

			// Making points unique
			ArrayList<Fraction> tcp = new ArrayList<Fraction>();
			if (cp.size() > 0) {
				tcp.add(cp.get(0));
			}
			for (int i = 1; i < cp.size(); ++i) {
				if (!cp.get(i).equals(cp.get(i - 1))) {
					tcp.add(cp.get(i));
				}
			}
			cp = tcp;
			
			// Checking each segment for being inside the polygon
			int icnt = 0;
			BigInteger[] bl = new BigInteger[3];
			for (int i = 0; i < 3; ++i)
				bl[i] = BigInteger.valueOf(l[i]);
			BigInteger d = bl[1].multiply(bl[1]).add(bl[2].multiply(bl[2]));
			Fraction x0 = new Fraction(bl[1].multiply(bl[0]).negate(), d);
			Fraction y0 = new Fraction(bl[2].multiply(bl[0]).negate(), d);
			Fraction dx = new Fraction(bl[2], d);
			Fraction dy = new Fraction(bl[1].negate(), d);

			/* Uncomment to see crossing points
			for (int i = 0; i < cp.size(); ++i) {
				Fraction px = x0.add(dx.mul(cp.get(i)));
				Fraction py = y0.add(dy.mul(cp.get(i)));
				System.out.println(px + " " + py);
			}*/
			
			loop: for (int i = 0; i < cp.size() - 1; ++i) {
				Fraction t = cp.get(i).add(cp.get(i + 1)).div(new Fraction(2, 1));
				Fraction px = x0.add(dx.mul(t));
				Fraction py = y0.add(dy.mul(t));
				
				for (int j = 0; j < n; ++j) {
					int j1 = (j + 1) % n;
					long[] ln = vmul(pc[j], pc[j1]);
					Fraction f = px.mul(new Fraction(ln[1], 1)).add(py.mul(new Fraction(ln[2], 1))).add(
							new Fraction(ln[0], 1));
					if (f.p.equals(BigInteger.ZERO)) {
						if (between(new Fraction(x[j], 1), px, new Fraction(x[j1], 1))
								&& between(new Fraction(y[j], 1), py, new Fraction(y[j1], 1))) {
							continue loop;
						}
					}
				}
				int tcnt = 0;
				for (int j = 0; j < n; ++j) {
					int j1 = (j + 1) % n;
					int u = j, u1 = j1;
					if (y[j] < y[j1]) {
						u = j1;
						u1 = j;
					}
					if (py.compareTo(new Fraction(y[u], 1)) >= 0)
						continue;
					if (py.compareTo(new Fraction(y[u1], 1)) < 0)
						continue;
					Fraction cx = py.sub(new Fraction(y[u1], 1)).div(new Fraction(y[u] - y[u1], 1)).mul(
							new Fraction(x[u] - x[u1], 1)).add(new Fraction(x[u1], 1));
					if (cx.compareTo(px) > 0) {
						++tcnt;
					}
				}
				if (tcnt % 2 == 1) {
					++icnt;
				}
			}

			if (icnt != 1) {
				quit(WA, "The polygon was divided to " + (icnt + 1) + " parts");
			}

			// Calculating m and k
			int[] sgn = new int[n];
			for (int i = 0; i < n; ++i) {
				sgn[i] = (int) Math.round(Math.signum(smul(pc[i], l)));
			}
			int tm = 0, tk = 0;
			for (int i = 0; i < n; ++i) {
				if (sgn[i] < 0)
					++tm;
				if (sgn[i] > 0)
					++tk;
				int i1 = (i + 1) % n;
				if (sgn[i] * sgn[i1] < 0) {
					++tm;
					++tk;
				}
				if (sgn[i] == 0) {
					int i0 = (i + n - 1) % n;
					if (sgn[i1] < 0) ++tm;
					if (sgn[i1] > 0) ++tk;
					if (sgn[i1] != sgn[i0]) {
						if (sgn[i0] < 0) ++tm;
						if (sgn[i0] > 0) ++tk;
					}
				}
			}

			if ((m != tm || k != tk) && (m != tk || k != tm)) {
				quit(WA, "Polygon was divided into (" + tm + ", " + tk + ") instead of (" + m + ", " + k + ")");
			}

			// Any mistakes in contestant's solution should have been found before this line
			if (ja.equals(NO))
				quit(FAIL, "Contestant found a solution");
			quit(OK, YES);
		}
		return null;
	}

	long[] vmul(long[] a, long[] b) {
		long[] ans = new long[3];
		for (int i = 0; i < 3; ++i) {
			ans[i] = a[(i + 1) % 3] * b[(i + 2) % 3] - b[(i + 1) % 3] * a[(i + 2) % 3];
		}
		return ans;
	}

	long smul(long[] a, long[] b) {
		long ans = 0;
		for (int i = 0; i < 3; ++i) {
			ans += a[i] * b[i];
		}
		return ans;
	}

	boolean isZero(long[] a) {
		for (int i = 0; i < 3; ++i) {
			if (a[i] != 0)
				return false;
		}
		return true;
	}

	boolean between(Fraction l, Fraction m, Fraction r) {
		return l.compareTo(m) <= 0 && m.compareTo(r) <= 0 || r.compareTo(m) <= 0 && m.compareTo(l) <= 0;
	}
	
	boolean between(long l, long m, long r) {
		return l <= m && m <= r || r <= m && m <= l;
	}

	class Fraction implements Comparable<Fraction> {

		BigInteger p, q;

		public Fraction(long p, long q) {
			this.p = BigInteger.valueOf(p);
			this.q = BigInteger.valueOf(q);
			norm();
		}

		public Fraction(BigInteger p, BigInteger q) {
			this.p = p;
			this.q = q;
			norm();
		}

		void norm() {
			if (q.compareTo(BigInteger.ZERO) < 0) {
				p = p.negate();
				q = q.negate();
			}
		}

		Fraction mul(Fraction o) {
			return new Fraction(p.multiply(o.p), q.multiply(o.q));
		}

		Fraction div(Fraction o) {
			return new Fraction(p.multiply(o.q), q.multiply(o.p));
		}

		Fraction add(Fraction o) {
			return new Fraction(p.multiply(o.q).add(o.p.multiply(q)), q.multiply(o.q));
		}

		Fraction sub(Fraction o) {
			return new Fraction(p.multiply(o.q).subtract(o.p.multiply(q)), q.multiply(o.q));
		}

		@Override
		public int compareTo(Fraction o) {
			return p.multiply(o.q).compareTo(o.p.multiply(q));
		}

		@Override
		public boolean equals(Object o) {
			return (o instanceof Fraction) && compareTo((Fraction) o) == 0;
		}
		
		@Override
		public String toString() {
			double t = p.doubleValue() / q.doubleValue();
			return t + "";
		}
	}
}
