#include <bits/stdc++.h>
using namespace std;
const int mx[] = {-2, -1, 1, 2, 2, 1, -1, -2};
const int my[] = {1, 2, 2, 1, -1, -2, -2, -1};
long long k, n;
int f[5005][5005], ans[505];
struct node {
  int x, y, step;
};
queue<node> q;
void bfs() {
  f[2000][2000] = 1;
  q.push((node){2000, 2000, 0});
  ans[0] = 1;
  while (!q.empty()) {
    node t = q.front();
    q.pop();
    for (int i = 0; i < 8; i++) {
      int u = t.x + mx[i], v = t.y + my[i];
      if (f[u][v] != 0 || t.step == min(k, (long long)500)) continue;
      f[u][v] = 1;
      ans[t.step + 1]++;
      q.push((node){u, v, t.step + 1});
    }
  }
}
int main() {
  cin >> k >> n;
  long long x, y;
  for (long long i = 1; i <= n; i++) {
    scanf("%lld %lld", &x, &y);
    f[x + 2000][y + 2000] = 1;
  }
  bfs();
  long long res = 0;
  if (k <= 500) {
    for (int i = 0; i <= k; i++) {
      res += ans[i];
      res %= 1000000007;
    }
    cout << res << endl;
    return 0;
  }
  long long d = ans[500] - ans[499];
  for (int i = 0; i < 500; i++) res = (res + ans[i]) % 1000000007;
  (k -= 499) %= 1000000007;
  res = (res + ans[500] * k + (k - 1) * k / 2 % 1000000007 * d) % 1000000007;
  cout << res << endl;
  return 0;
}
