import java.io.*;
import java.util.*;

public class fields_pk_wa2 {

	PrintWriter out;
	BufferedReader br;
	StringTokenizer st;

	String nextToken() throws IOException {
		while ((st == null) || (!st.hasMoreTokens()))
			st = new StringTokenizer(br.readLine());
		return st.nextToken();
	}

	public int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	public long nextLong() throws IOException {
		return Long.parseLong(nextToken());
	}

	public double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}

	class Point {
		int x, y;

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

		@Override
		public String toString() {
			return "Point [x=" + x + ", y=" + y + "]";
		}
		
		
	}
	
	public void solve() throws IOException {
		int n = nextInt();
		Point[] first = new Point[n];
		for (int i = 0; i < n; i++)
			first[i] = new Point(nextInt(), nextInt());
		Point[] second = new Point[n];
		for (int i = 0; i < n; i++)
			second[i] = new Point(nextInt(), nextInt());
		
		if (check(first, second)) {
			out.println("YES");
			return;
		}
		invertX(first);
		//System.err.println(Arrays.deepToString(first));
		//System.err.println(Arrays.deepToString(second));
		if (check(first, second)) {
			out.println("YES");
			return;
		}
		invertY(first);
		if (check(first, second)) {
			out.println("YES");
			return;
		}
		invertX(first);
		if (check(first, second)) {
			out.println("YES");
			return;
		}
		
		invertXY(first);
		if (check(first, second)) {
			out.println("YES");
			return;
		}
		
		invertX(first);
		//System.err.println(Arrays.deepToString(first));
		//System.err.println(Arrays.deepToString(second));
		if (check(first, second)) {
			out.println("YES");
			return;
		}
		invertY(first);
		if (check(first, second)) {
			out.println("YES");
			return;
		}
		invertX(first);
		if (check(first, second)) {
			out.println("YES");
			return;
		}
		
		//!--------------------------------

		reverse(first);
		if (check(first, second)) {
			out.println("YES");
			return;
		}
		invertX(first);
		//System.err.println(Arrays.deepToString(first));
		//System.err.println(Arrays.deepToString(second));
		if (check(first, second)) {
			out.println("YES");
			return;
		}
		invertY(first);
		if (check(first, second)) {
			out.println("YES");
			return;
		}
		invertX(first);
		if (check(first, second)) {
			out.println("YES");
			return;
		}
		
		invertXY(first);
		if (check(first, second)) {
			out.println("YES");
			return;
		}
		
		invertX(first);
		//System.err.println(Arrays.deepToString(first));
		//System.err.println(Arrays.deepToString(second));
		if (check(first, second)) {
			out.println("YES");
			return;
		}
		invertY(first);
		if (check(first, second)) {
			out.println("YES");
			return;
		}
		invertX(first);
		if (check(first, second)) {
			out.println("YES");
			return;
		}

		
		out.println("NO");
		
	}

	
	
	private void invertXY(Point[] first) {
		for (Point x : first) {
			int tmp = x.x;
			x.x = x.y;
			x.y = tmp;
		}
		reverse(first);
	}

	private boolean check(Point[] a, Point[] b) {
		int minA = 0;
		int n = a.length;
		for (int i = 1; i < n; i++) {
			if (a[i].x < a[minA].x)
				minA = i;
			if ((a[i].x == a[minA].x) && (a[i].y < a[minA].y)) {
				minA = i;
			}
		}
		
		int minB = 0;
		for (int i = 1; i < n; i++) {
			if (b[i].x < b[minB].x)
				minB = i;
			if ((b[i].x == b[minB].x) && (b[i].y < b[minB].y)) {
				minB = i;
			}
		}
		
		int diff = 0;
		int dx = b[minB].x - a[minA].x;
		int dy = b[minB].y - a[minA].y;
		
		for (int i = 0; i < n; i++) {
			int curB = i + diff;
			curB += n;
			curB %= n;
			if ((b[curB].x != a[i].x + dx) || (b[curB].y != a[i].y + dy))
				return false;
		}
		return true;
	}

	private void invertY(Point[] first) {
		for (Point x : first)
			x.y = -x.y;
		reverse(first);
	}

	private void invertX(Point[] first) {
		for (Point x : first) {
			x.x = -x.x;
		}
		reverse(first);
	}

	private void reverse(Point[] first) {
		ArrayList<Point> rev = new ArrayList<fields_pk_wa2.Point>(Arrays.asList(first));
		Collections.reverse(rev);
		rev.toArray(first);
		
	}

	public void run() {
		try {
			br = new BufferedReader(new InputStreamReader(System.in));
			out = new PrintWriter(System.out);

			br = new BufferedReader(new FileReader("fields.in"));
			out = new PrintWriter("fields.out");

			solve();

			out.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	public static void main(String[] args) {
		new fields_pk_wa2().run();
	}
}
