import ru.ifmo.validate.*;
import java.util.*;

public class Validate implements Validator {
	static final int MAX_N = 100000;
	static final int MAX = 1000000000;

	public class Point {
		long x, y;
		int ind;

		public Point(int x, int y, int ind) {
			this.x = x;
			this.y = y;
			this.ind = ind;
		}

		public long distanceSquared(Point p) {
			return (x - p.x) * (x - p.x) + (y - p.y) * (y - p.y);
		}
	}

	public long vmulFromPoint(Point from, Point v, Point u) {
		long x1 = v.x - from.x;
		long y1 = v.y - from.y;
		long x2 = u.x - from.x;
		long y2 = u.y - from.y;
		return x2 * y1 - x1 * y2;
	}

	public int convexRight(Point[] p) {
		p = p.clone();
		for (int i = 1; i < p.length; i++) {
			if (p[i].x < p[0].x || p[i].x == p[0].x && p[i].y < p[0].y) {
				Point t = p[i];
				p[i] = p[0];
				p[0] = t;
			}
		}
		final Point first = p[0];
		Arrays.sort(p, 1, p.length, new Comparator<Point>() {
			public int compare(Point o1, Point o2) {
				long d = vmulFromPoint(first, o1, o2);
				if (d == 0) {
					return Long.signum(first.distanceSquared(o1)
							- first.distanceSquared(o2));
				}
				return -Long.signum(d);
			}
		});

		int cur = 2;
		for (int i = 2; i < p.length; i++) {
			Point add = p[i];
			if (cur > 2) {
				if (vmulFromPoint(p[cur - 2], p[cur - 1], add) <= 0) {
					return 1;
				}
			}
			p[cur++] = add;
		}

		for (int i = 0; i < p.length; i++) {
			if ((p[i].ind - p[0].ind + p.length) % p.length != i)
				return 2;
		}

		return 0;
	}

	@Override
	public void validate(ValidatingScanner in) throws Exception {
		int n = in.nextInt(1, MAX_N);

		Point[] p = new Point[n];

		for (int i = 0; i < n; i++) {
			in.eoln();
			p[i] = new Point(in.nextInt(-MAX, MAX), in.nextInt(-MAX, MAX), i);
		}

		int outcome = convexRight(p);

		if (outcome == 1) {
			throw new AssertionError("Given polygon isn't convex.");
		}

		if (outcome == 2) {
			throw new AssertionError("The order isn't clockwise.");
		}
	}
}
