#include <bits/stdc++.h>
using namespace std;
int x[2005 * 2005], y[2005 * 2005], no[25][25], flag[2005][2005];
int n, i, A, X, Y;
long long k, tmp, ans, delta, now;
const int dx[8] = {-2, -1, 1, 2, 2, 1, -1, -2};
const int dy[8] = {1, 2, 2, 1, -1, -2, -2, -1};
const int P = 1000000007;
inline int cheat_for_30() {
  int h = 0, t = 1, ans = 1;
  x[1] = 0;
  y[1] = 0;
  flag[A][A] = 0;
  if (!k) return 1;
  while (h < t) {
    int X = x[++h], Y = y[h], upd = flag[X + A][Y + A] + 1;
    for (int d = 0; d < 8; d++) {
      int xx = X + dx[d], yy = Y + dy[d];
      if (flag[xx + A][yy + A] <= upd) continue;
      flag[xx + A][yy + A] = upd;
      ans++;
      if (upd == 500) delta++;
      if (upd < k) x[++t] = xx, y[t] = yy;
    }
  }
  return ans;
}
inline int cheat_for_fun() {
  if (k == 0) return 1;
  if (k == 1) return 9;
  if (k == 2) return 41;
  if (k == 3) return 109;
  if (k == 4) return 205;
  long long ans = 325, tmp;
  k -= 5;
  if (k & 1)
    tmp = ((k + 1) / 2 % P) * (k % P) % P;
  else
    tmp = (k / 2 % P) * ((k + 1) % P) % P;
  return (ans + k % P * 120 + 28 * tmp % P) % P;
}
int main() {
  scanf("%I64d%d", &k, &n);
  A = 1000;
  memset(flag, 60, sizeof(flag));
  for (i = 1; i <= n; i++) scanf("%d%d", &X, &Y), flag[X + A][Y + A] = -1;
  if (k <= 500) {
    printf("%d", cheat_for_30());
    return 0;
  }
  tmp = k;
  k = 500;
  now = cheat_for_30();
  if (now <= 1000) {
    printf("%d", now);
    return 0;
  }
  k = tmp;
  k -= 500;
  if (k & 1)
    tmp = ((k + 1) / 2 % P) * (k % P) % P;
  else
    tmp = (k / 2 % P) * ((k + 1) % P) % P;
  ans = (now + (k % P * delta % P) + tmp * 28 % P) % P;
  printf("%I64d", ans);
  return 0;
}
