#include <bits/stdc++.h>
using namespace std;
const int N = 1500;
const int M = N * N * 4;
const long long p = 1000000007;
int d[2 * N][2 * N];
bool ok[2 * N][2 * N];
pair<int, int> o[M];
long long k, ans;
int n, b, e;
int dx[8] = {1, 2, 2, 1, -1, -2, -2, -1};
int dy[8] = {2, 1, -1, -2, -2, -1, 1, 2};
long long calc(int w) {
  e = b = 0;
  for (int i = -N + 1; i < N; i++)
    for (int j = -N + 1; j < N; j++) d[i + N][j + N] = 1 << 20;
  o[b++] = make_pair(0, 0);
  d[0 + N][0 + N] = 0;
  while (b != e) {
    pair<int, int> a = o[e++];
    if (e == M) e = 0;
    if (d[a.first + N][a.second + N] == w) continue;
    for (int t = 0; t < (int)8; ++t) {
      if (d[a.first + dx[t] + N][a.second + dy[t] + N] >
              d[a.first + N][a.second + N] + 1 &&
          ok[a.first + dx[t] + N][a.second + dy[t] + N]) {
        d[a.first + dx[t] + N][a.second + dy[t] + N] =
            d[a.first + N][a.second + N] + 1;
        o[b++] = make_pair(a.first + dx[t], a.second + dy[t]);
        if (b == M) b = 0;
      }
    }
  }
  long long ans = 0;
  for (int i = -N + 1; i < N; i++)
    for (int j = -N + 1; j < N; j++)
      if (d[i + N][j + N] < (1 << 20)) ans++;
  return ans;
}
int main() {
  memset(ok, true, sizeof ok);
  scanf("%I64d%d", &k, &n);
  long long w = 500;
  w = min(k, w);
  for (int i = 0; i < (int)n; ++i) {
    int x, y;
    scanf("%d%d", &x, &y);
    ok[x + N][y + N] = false;
  }
  long long ans = calc(w);
  long long ans2 = calc(w + 1);
  long long add = ans2 - ans;
  if (ans < 100) {
    printf("%I64d\n", ans);
    return 0;
  }
  k -= w;
  k %= p;
  k--;
  long long rez =
      (((((2 * add + 28 * k) % p) * (k + 1)) % p) * ((p + 1) / 2)) % p;
  cerr << "ans"
       << " = " << ans << endl;
  printf("%I64d\n", (ans + rez) % p);
  return 0;
}
