import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.util.Random;
import java.util.StringTokenizer;

/**
 * @author Dmitry Abdrashitov
 */
public class gentest_da implements Runnable {
	
	private PrintWriter out;
	private BufferedReader in;
	private StringTokenizer st;
	
	private void solve() throws Exception {
		Random rnd = new Random(366);
		int n = nextInt();
		if (n < 1 || n > 300) {
			throw new Exception("Wrong input data");
		}
		int[] x = new int[n];
		int[] y = new int[n];
		int cnt = 0;
		while (cnt < n) {
			int x0 = -10000 + rnd.nextInt(20001);
			int y0 = -10000 + rnd.nextInt(20001);
			boolean good = true;
			for (int i = 0; i < cnt; i++) {
				if (!good || x0 == x[i] || y0 == y[i]) {
					good = false;
					break;
				}
				for (int j = 0; j < i; j++) {
					if (1L * (x[i] - x0) * (y[j] - y0) - 1L * (y[i] - y0) * (x[j] - x0) == 0) {
						good = false;
						break;
					}
				}
			}
			if (good) {
				x[cnt] = x0;
				y[cnt++] = y0;
			}
		}
		out.println("YES");
		for (int i = 0; i < n; i++) {
			out.println(x[i] + " " + y[i]);
		}
	}
	
	public void run() {
		try {
			solve();
		} catch (Exception e) {
			apstenu(e);
		} finally {
			out.close();
		}
	}
	
	private void apstenu(Exception e) {
		e.printStackTrace();
		System.exit(239);
	}
	
	private int nextInt() throws Exception {
		return Integer.parseInt(nextToken());
	}
	
	private String nextToken() throws Exception {
		while (!st.hasMoreTokens()) {
			String line = in.readLine();
			st = new StringTokenizer(line);
		}
		return st.nextToken();
	}
	
	private gentest_da(String name) {
		try {
			out = new PrintWriter(new FileWriter(name + ".out"));
			in = new BufferedReader(new FileReader(name + ".in"));
			st = new StringTokenizer("");
		} catch (Exception e) {
			apstenu(e);
		}
	}

	public static void main(String[] args) {
		new Thread(new gentest_da("gentest")).start();
	}
}
