Inaka has a disc, the circumference of which is n units. The circumference is equally divided by n points numbered clockwise from 1 to n, such that points i and i + 1 (1 ≤ i < n) are adjacent, and so are points n and 1.

There are m straight segments on the disc, the endpoints of which are all among the aforementioned n points.

Inaka wants to know if her image is rotationally symmetrical, i.e. if there is an integer k (1 ≤ k < n), such that if all segments are rotated clockwise around the center of the circle by k units, the new image will be the same as the original one.

Input

The first line contains two space-separated integers n and m (2 ≤ n ≤ 100 000, 1 ≤ m ≤ 200 000) — the number of points and the number of segments, respectively.

The i-th of the following m lines contains two space-separated integers a_i and b_i (1 ≤ a_i, b_i ≤ n, a_i ≠ b_i) that describe a segment connecting points a_i and b_i.

It is guaranteed that no segments coincide.

Output

Output one line — "Yes" if the image is rotationally symmetrical, and "No" otherwise (both excluding quotation marks).

You can output each letter in any case (upper or lower).

Examples

Input


12 6
1 3
3 7
5 7
7 11
9 11
11 3


Output


Yes


Input


9 6
4 5
5 6
7 8
8 9
1 2
2 3


Output


Yes


Input


10 3
1 2
3 2
7 2


Output


No


Input


10 2
1 6
2 7


Output


Yes

Note

The first two examples are illustrated below. Both images become the same as their respective original ones after a clockwise rotation of 120 degrees around the center.

<image>
import java.util.*;
import java.math.*;

// **** D. Chladni Figure ****

public class D {
	static char [] in = new char [1000000];
	static class HH extends HashSet<Integer>{public HH(int a){super(a);}};
	static class AL extends ArrayList<Integer>{public AL(int a){super (a);}};
	public static void main (String [] arg) throws Throwable {
		int n = nextInt();
		int m = nextInt();
		//int [] IN = new int [n]; // Clock
		//int [] OUT = new int [n]; // Counter
		HH [] AL = new HH[n];
		for (int i = 0; i<m; ++i) {
			int A = nextInt()-1;
			int B = nextInt()-1;
			if (AL[A] == null) AL[A] = new HH(30);
			if (AL[B] == null) AL[B] = new HH(30);
			AL[A].add(B);
			AL[B].add(A);
		}
		
		boolean cancan = isPeriodic(AL, 1, n);
		int [] primes = sieve(n+1);
		int n2 = n;
		for (int i = 0; i<primes.length && !cancan && n2 > 1; ++i) {
			if (n2 % primes[i] == 0) {
				int factor = n/primes[i];
				//System.err.println("Trying " + factor);
				cancan = isPeriodic(AL, factor, n);
				while (n2 % primes[i] == 0) n2 /= primes[i];
				//System.err.println("n is now " + n2);
			}
		}	
		System.out.println(cancan ? "Yes" : "No");
	}
	public static boolean isPeriodic(HH[] AL, int k, int n) {
				boolean works = true;
				//System.err.println("Trying period + " + k );
				for (int ii = k; ii<n && works; ++ii) {
					//System.err.println("Trying at " + ii);
					works = ((AL[ii] == null && AL[ii-k] == null) || equalMinus(AL[ii], AL[ii-k], k, n));
				}
				//System.err.println(works);
		return works;
	}
	public static boolean equalMinus(HH a1, HH a2, int k, int n) {
		if (a1 == null || a2 == null || a1.size() != a2.size()) return false;
		for (int i : a2) {
			if (!a1.contains((i + k) % n)) {
				//System.err.println("Incoming edge from " + i + " expected " + ((i+k)%n) + " but doesn't exist");
				return false;
			}
		}
		return true;
	}
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	/************** FAST IO CODE FOLLOWS *****************/
	public static long nextLong() throws Throwable {
		long i = System.in.read();boolean neg = false;while (i < 33) i = System.in.read();if (i == 45) {neg=true;i=48;}i = i - 48;
		int j = System.in.read();while (j > 32) {i*=10;i+=j-48;j = System.in.read();}return (neg) ? -i : i;
	}
	public static int nextInt() throws Throwable {return (int)nextLong();}
	public static String next() throws Throwable {
		int i = 0; while (i < 33 && i != -1) i = System.in.read(); int cptr = 0; while (i >= 33) { in[cptr++] = (char)i; i = System.in.read();}
		return new String(in, 0,cptr);
	}
	/**** LIBRARIES ****/
	public static long gcdL(long a, long b) {while (b != 0) {long tmp = b;b = (a % b);a = tmp;}return a;}
	public static int gcd(int a, int b) {while (b != 0) {int tmp = b;b = (a % b);a = tmp;}return a;}
	public static int[] sieve(int LIM) {
		int i,count = 0;
		boolean [] b = new boolean [LIM];
		for (i = 2;i<LIM; ++i) if (!b[i]) {count++; for (int j = i<<1; j<LIM; j+=i) b[j] = true;}
		int [] primes = new int[count];
		for (i = 2,count=0;i<LIM;++i) if (!b[i]) primes[count++] = i;
		return primes;
	}
	public static int[] numPrimeFactors(int LIM) {
		int i,count = 0;
		int [] b = new int [LIM];
		for (i = 2;i<LIM; ++i) if (b[i] == 0) {count++; for (int j = i; j<LIM; j+=i) b[j]++;}
		return b;
	}
}

/* Full Problem Text:
  
Inaka has a disc, the circumference of which is n units.
The circumference is equally divided by n points numbered clockwise from 1 to n, such that points i and i + 1 (1 <q i < n) are adjacent, and so are points n and 1.
There are m straight segments on the disc, the endpoints of which are all among the aforementioned n points.
Inaka wants to know if her image is rotationally symmetrical, i.e. if there is an integer k (1 <q k < n),
such that if all segments are rotated clockwise around the center of the circle by k units, the new image will be the same as the original one.

 */