#include <bits/stdc++.h>
using namespace std;
long long gcd(long long n, long long m) { return m == 0 ? n : gcd(m, n % m); }
long long lcm(long long n, long long m) { return (m * n) / gcd(n, m); }
void print(std::vector<long long>& ar) {
  for (auto& a : (ar)) {
    cout << (a) << ' ';
  };
}
long long dx[] = {1, 0};
long long dy[] = {0, 1};
const long long INF = 1e18;
long long const N = 2e5 + 10;
long long const M = 210;
double const PI = acos(-1);
long long const MOD = 998244353;
vector<long long> factor[N + 10];
long long sum = 0;
void sieve() {
  for (long long i = 1; i <= N; i++) {
    for (long long j = i; j <= N; j += i) {
      factor[j].push_back(i);
      sum++;
    }
  }
}
long long n, m;
vector<long long> store[N];
void calc(vector<long long>& temp) {
  sort((temp.begin()), (temp.end()));
  temp.push_back(temp.front() + n);
  for (long long i = 1; i < temp.size(); i++) {
    temp[i - 1] = temp[i] - temp[i - 1];
  }
  temp.pop_back();
}
bool period(vector<long long>& temp, long long p) {
  for (long long i = 0; i < temp.size(); i += p) {
    for (long long j = i; j < i + p; j++) {
      if (temp[j] != temp[j % p]) return false;
    }
  }
  return true;
}
long long find_period(vector<long long>& temp) {
  vector<long long> fact = factor[(long long)temp.size()];
  for (long long c : fact) {
    if (period(temp, c)) {
      long long sum = 0;
      for (long long i = 0; i < c; i++) sum += temp[i];
      return sum;
    }
  }
  return n;
}
set<pair<long long, long long> > S;
vector<pair<long long, long long> > num;
int32_t main() {
  sieve();
  cin >> n >> m;
  for (long long i = 0; i < m; i++) {
    long long a, b;
    cin >> a >> b;
    num.push_back({a, b});
    S.insert({a, b});
  }
  factor[n].pop_back();
  for (auto c : factor[n]) {
    bool flag = true;
    for (long long i = 0; i < num.size(); i++) {
      long long a = num[i].first + c;
      a = a > n ? a - n : a;
      long long b = num[i].second + c;
      b = b > n ? b - n : b;
      if (S.find({a, b}) == S.end() && S.find({b, a}) == S.end()) {
        flag = false;
        break;
      }
    }
    if (flag) {
      cout << "Yes";
      return 0;
    }
  }
  cout << "No";
}

### Prompt

Create a solution in cpp for the following problem:

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>

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
long long gcd(long long n, long long m) { return m == 0 ? n : gcd(m, n % m); }
long long lcm(long long n, long long m) { return (m * n) / gcd(n, m); }
void print(std::vector<long long>& ar) {
  for (auto& a : (ar)) {
    cout << (a) << ' ';
  };
}
long long dx[] = {1, 0};
long long dy[] = {0, 1};
const long long INF = 1e18;
long long const N = 2e5 + 10;
long long const M = 210;
double const PI = acos(-1);
long long const MOD = 998244353;
vector<long long> factor[N + 10];
long long sum = 0;
void sieve() {
  for (long long i = 1; i <= N; i++) {
    for (long long j = i; j <= N; j += i) {
      factor[j].push_back(i);
      sum++;
    }
  }
}
long long n, m;
vector<long long> store[N];
void calc(vector<long long>& temp) {
  sort((temp.begin()), (temp.end()));
  temp.push_back(temp.front() + n);
  for (long long i = 1; i < temp.size(); i++) {
    temp[i - 1] = temp[i] - temp[i - 1];
  }
  temp.pop_back();
}
bool period(vector<long long>& temp, long long p) {
  for (long long i = 0; i < temp.size(); i += p) {
    for (long long j = i; j < i + p; j++) {
      if (temp[j] != temp[j % p]) return false;
    }
  }
  return true;
}
long long find_period(vector<long long>& temp) {
  vector<long long> fact = factor[(long long)temp.size()];
  for (long long c : fact) {
    if (period(temp, c)) {
      long long sum = 0;
      for (long long i = 0; i < c; i++) sum += temp[i];
      return sum;
    }
  }
  return n;
}
set<pair<long long, long long> > S;
vector<pair<long long, long long> > num;
int32_t main() {
  sieve();
  cin >> n >> m;
  for (long long i = 0; i < m; i++) {
    long long a, b;
    cin >> a >> b;
    num.push_back({a, b});
    S.insert({a, b});
  }
  factor[n].pop_back();
  for (auto c : factor[n]) {
    bool flag = true;
    for (long long i = 0; i < num.size(); i++) {
      long long a = num[i].first + c;
      a = a > n ? a - n : a;
      long long b = num[i].second + c;
      b = b > n ? b - n : b;
      if (S.find({a, b}) == S.end() && S.find({b, a}) == S.end()) {
        flag = false;
        break;
      }
    }
    if (flag) {
      cout << "Yes";
      return 0;
    }
  }
  cout << "No";
}

```