#include <bits/stdc++.h>
using namespace std;
vector<long long> v;
set<long long> ss;
long long n, m;
long long chord(long long x, long long y) {
  x = x % n;
  y = y % n;
  if (x > y)
    return (y << 32) | x;
  else
    return (x << 32) | y;
}
long long rotate(long long c, long long a) {
  long long x = c >> 32;
  long long y = c & ((1LL << 32) - 1);
  return chord(x + a, y + a);
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    long long a, b, c;
    cin >> a >> b;
    c = chord(a, b);
    v.push_back(c);
    ss.insert(c);
  }
  for (int i = 1; i < n; i++) {
    if (n % i) continue;
    bool ok = true;
    for (int j = 0; j < v.size(); j++) {
      long long x = v[j];
      if (!ss.count(rotate(x, i))) {
        ok = false;
        break;
      }
    }
    if (ok) {
      printf("Yes\n");
      return 0;
    }
  }
  printf("No\n");
  return 0;
}
