Problem: After the war, the supersonic rocket became the most common public transportation.

Each supersonic rocket consists of two "engines". Each engine is a set of "power sources". The first engine has n power sources, and the second one has m power sources. A power source can be described as a point (x_i, y_i) on a 2-D plane. All points in each engine are different.

You can manipulate each engine separately. There are two operations that you can do with each engine. You can do each operation as many times as you want.

  1. For every power source as a whole in that engine: (x_i, y_i) becomes (x_i+a, y_i+b), a and b can be any real numbers. In other words, all power sources will be shifted.
  2. For every power source as a whole in that engine: (x_i, y_i) becomes (x_i cos θ - y_i sin θ, x_i sin θ + y_i cos θ), θ can be any real number. In other words, all power sources will be rotated.



The engines work as follows: after the two engines are powered, their power sources are being combined (here power sources of different engines may coincide). If two power sources A(x_a, y_a) and B(x_b, y_b) exist, then for all real number k that 0 < k < 1, a new power source will be created C_k(kx_a+(1-k)x_b,ky_a+(1-k)y_b). Then, this procedure will be repeated again with all new and old power sources. After that, the "power field" from all power sources will be generated (can be considered as an infinite set of all power sources occurred).

A supersonic rocket is "safe" if and only if after you manipulate the engines, destroying any power source and then power the engine, the power field generated won't be changed (comparing to the situation where no power source erased). Two power fields are considered the same if and only if any power source in one field belongs to the other one as well.

Given a supersonic rocket, check whether it is safe or not.

Input

The first line contains two integers n, m (3 ≤ n, m ≤ 10^5) — the number of power sources in each engine.

Each of the next n lines contains two integers x_i and y_i (0≤ x_i, y_i≤ 10^8) — the coordinates of the i-th power source in the first engine.

Each of the next m lines contains two integers x_i and y_i (0≤ x_i, y_i≤ 10^8) — the coordinates of the i-th power source in the second engine.

It is guaranteed that there are no two or more power sources that are located in the same point in each engine.

Output

Print "YES" if the supersonic rocket is safe, otherwise "NO".

You can print each letter in an arbitrary case (upper or lower).

Examples

Input

3 4
0 0
0 2
2 0
0 2
2 2
2 0
1 1


Output

YES


Input

3 4
0 0
0 2
2 0
0 2
2 2
2 0
0 0


Output

NO

Note

The first sample:

<image> Those near pairs of blue and orange points actually coincide.

First, manipulate the first engine: use the second operation with θ = π (to rotate all power sources 180 degrees).

The power sources in the first engine become (0, 0), (0, -2), and (-2, 0).

<image>

Second, manipulate the second engine: use the first operation with a = b = -2.

The power sources in the second engine become (-2, 0), (0, 0), (0, -2), and (-1, -1).

<image>

You can examine that destroying any point, the power field formed by the two engines are always the solid triangle (0, 0), (-2, 0), (0, -2).

In the second sample, no matter how you manipulate the engines, there always exists a power source in the second engine that power field will shrink if you destroy it. 

Solution (in JAVA):

Solution:

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.StringTokenizer;


public class Main {
	
	
	public static boolean kmp(double[] s, double[] w){
		int[] t = buildTable(w);
		return search(s, w, t);
	}
	public static boolean doubleEquals(double a, double b){
		return Math.abs(a - b) < 1e-9;
	}
	public static int[] buildTable(double[] w){
		
		int[] t = new int[w.length];
		t[0] = -1;
		t[1] = 0;
		int pos = 2;
		int end = 0;
		while(pos < t.length){
			if(doubleEquals(w[pos-1], w[end])){
				t[pos] = end + 1;
				pos++;
				end++;
			}
			else if(end > 0){
				end = t[end];
			}
			else{
				t[pos] = 0;
				pos++;
			}
		}
		return t;
	}
	static int N;
	public static boolean search(double[] s,double[] w,int[] t){
		
		int i = 0;
		int j = 0;
		int maxJ = 0;
		while(i < s.length){
			if(j == w.length){
				return true;
			}
			if(doubleEquals(s[i], w[j])){
				i++;
				j++;
				maxJ = Math.max(maxJ, j);
				if(i == s.length && j == w.length){
					return true;
				}
			}
			else{
				if(j == 0){
					i++;
				}
				else{
					j = t[j];
				}
			}
		}
		return false;
	}
	
	
	public static class Point implements Comparable<Point>{
		double x;
		double y;
		double t;
		double t2;
		public Point(double x, double y){
			this.x = x;
			this.y = y;
		}
		@Override
		public int compareTo(Point p){
			return this.t == p.t ? Double.compare(this.t2, p.t2) : 
				Double.compare(this.t,  p.t); 
		}
	}
	public static double calcAngle(Point p1, Point p2){
		if(p1.x == p2.x){
			return 90;
		}
		double tan = (p1.y - p2.y) / (p1.x - p2.x);
		double angle = Math.toDegrees((Math.atan(Math.abs(tan))));
		return tan < 0 ? 180 - angle : angle; 
	}
	public static boolean convex(Point p1, Point p2, Point p3){
		double det = ((p3.x - p2.x) * (p1.y - p2.y)) - ((p1.x - p2.x) * (p3.y - p2.y));
		return det > 0;
	}
	
	public static ArrayList<Point> convexHull(Point[] points, int n){
		int min = 0;
		
		for(int i = 0; i < n; i++){
			if(points[i].y < points[min].y){
				min = i;
			}
			else if(points[i].y == points[min].y && points[i].x < points[min].x){
				min = i;
			}
		}
		
		for(int i = 0; i < n; i++){
			points[i].t = calcAngle(points[i], points[min]);
			points[i].t2 = getDist(points[i], points[min]);
		}
		
		points[min].t = -1;	
		ArrayList<Point> sorted = new ArrayList<Point>();
		for(int i = 0; i < n; i++){
			sorted.add(points[i]);
		}
		Collections.sort(sorted);
		
		ArrayList<Point> convexHull = new ArrayList<Point>();
		
		sorted.add(sorted.get(0));
		
		convexHull.add(sorted.get(0));
		convexHull.add(sorted.get(1));
		int i = 2;
		
		while(i < n + 1){
			int last = convexHull.size() - 1;
			if(convex(convexHull.get(last - 1), convexHull.get(last), sorted.get(i))){
				convexHull.add(sorted.get(i));
				i++;
			}
			else{
				convexHull.remove(last);
				if(convexHull.size() == 1){
					convexHull.add(sorted.get(i));
					i++;
				}
			}
		}
		convexHull.remove(convexHull.size() - 1);
		return convexHull;
	}
	
	public static double getAngle(Point p1, Point p2, Point p3){
		
		double x21 = p1.x - p2.x;
		double y21 = p1.y - p2.y;
		
		double x23 = p3.x - p2.x;
		double y23 = p3.y - p2.y;
		double dot = (x21 * x23) + (y21 * y23);
		double mag1 = Math.sqrt((x21 * x21) + (y21 * y21));
		double mag2 = Math.sqrt((x23 * x23) + (y23 * y23));
		
		
		return Math.acos(dot / (mag1 * mag2)) * 180.0 / Math.PI;
	}
	
	public static double getDist(Point p1, Point p2){
		return Math.sqrt((p1.x - p2.x) * (p1.x - p2.x) + (p1.y - p2.y) * (p1.y - p2.y));
	}
	
	public static void main(String[] args){
		/*
		System.out.println(getAngle(new Point(5999, 35988001), 
				new Point(6000, 36000000), 
				new Point(0, 36000000)));

		System.out.println(getAngle(new Point(35988001, 1), 
				new Point(36000000, 0), 
				new Point(36000000, 6000)));
		
		System.out.println(getAngle(new Point(6000, 36000000), 
				new Point(0, 36000000),
				new Point(0, 0)));

		System.out.println(getAngle(new Point(36000000, 0), 
				new Point(36000000, 6000),
				new Point(0, 6000)));
		*/
		InputReader sc = new InputReader(System.in);
		PrintWriter out = new PrintWriter(System.out);
		
		
		int n = sc.nextInt();
		int m = sc.nextInt();
		
		Point[] pointsA = new Point[n];
		for(int i = 0; i < n; i++){
			pointsA[i] = new Point(sc.nextDouble(),sc.nextDouble());
		}
		
		Point[] pointsB = new Point[m];
		for(int i = 0 ;i < m; i++){
			pointsB[i] = new Point(sc.nextDouble(),sc.nextDouble());
		}
		
		ArrayList<Point> convexHullA = convexHull(pointsA, n);
		ArrayList<Point> convexHullB = convexHull(pointsB, m);
		
		if(convexHullB.size() == convexHullA.size()){
			
			int len = convexHullA.size();
			if(len == 1){
				double distA = 0.0;
				double distB = 0.0;
				Point min = new Point(Integer.MAX_VALUE, Integer.MAX_VALUE);
				Point max = new Point(0, 0);
				if(pointsA[0].x == pointsA[1].x){
					for(Point p : pointsA){
						if(p.y < min.y){
							min = p;
						}
						if(p.y > max.y){
							max = p;
						}
					}
					
				}
				else{
					for(Point p : pointsA){
						if(p.x < min.x){
							min = p;
						}
						if(p.x > max.x){
							max = p;
						}
					}
				}
				distA = getDist(min, max);
				
				min = new Point(Integer.MAX_VALUE, Integer.MAX_VALUE);
				max = new Point(0, 0);
				if(pointsB[0].x == pointsB[1].x){
					for(Point p : pointsB){
						if(p.y < min.y){
							min = p;
						}
						if(p.y > max.y){
							max = p;
						}
					}
				}
				else{
					for(Point p : pointsB){
						if(p.x < min.x){
							min = p;
						}
						if(p.x > max.x){
							max = p;
						}
					}
				}
				distB = getDist(min, max);
				System.out.println(distA == distB ? "YES" : "NO");
			}
			else{
				double[] stringA = new double[len * 4];
				
				double[] stringB = new double[len * 2];
				
				stringA[0] = getAngle(convexHullA.get(len - 1), convexHullA.get(0), convexHullA.get(1));
				stringA[1] = getDist(convexHullA.get(0), convexHullA.get(1));;
				stringA[2 * len] = stringA[0];
				stringA[(2 * len) + 1] = stringA[1];
				
				for(int i = 1; i < len; i++){
					stringA[2 * i] = getAngle(convexHullA.get(i - 1), convexHullA.get(i), 
							convexHullA.get((i + 1) % len));
					stringA[(2 * i) + 1] = getDist(convexHullA.get(i), convexHullA.get((i + 1) % len));
					stringA[(2 * i) + (2 * len)] = stringA[2 * i];
					stringA[(2 * i) + (2 * len) + 1] = stringA[(2 * i) + 1];
				}
				
				stringB[0] = getAngle(convexHullB.get(len - 1), convexHullB.get(0), convexHullB.get(1));
				stringB[1] = getDist(convexHullB.get(0), convexHullB.get(1));;
				
				for(int i = 1; i < len; i++){
					stringB[2 * i] = getAngle(convexHullB.get(i - 1), convexHullB.get(i), convexHullB.get((i + 1) % len));
					stringB[(2 * i) + 1] = getDist(convexHullB.get(i), convexHullB.get((i + 1) % len));
					
				}
				
				System.out.println(kmp(stringA, stringB) ? "YES" : "NO");
			}
			
		}
		else{
			System.out.println("NO");
		}
		
		
		
		out.close();
	}
	
	
	static class InputReader {
		public BufferedReader reader;
		public StringTokenizer tokenizer;

		public InputReader(InputStream stream) {
			reader = new BufferedReader(new InputStreamReader(stream), 32768);
			tokenizer = null;
		}

		public String next() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return tokenizer.nextToken();
		}

		public int nextInt() {
			return Integer.parseInt(next());
		}

		public long nextLong() {
			return Long.parseLong(next());
		}

		public double nextDouble() {
			return Double.parseDouble(next());
		}

		public String nextLine() {
			String str = "";
			try {
				str = reader.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}

			return str;
		}
	}
}