#include <bits/stdc++.h>
using namespace std;
int n;
long long k;
int reflag[1250 * 2 + 10][1250 * 2 + 10];
struct node {
  int x, y, z;
  inline node(int x_ = 0, int y_ = 0, int z_ = 0) {
    x = x_, y = y_;
    z = z_;
  }
} Q[4000000 + 10];
const int bx[9] = {0, 1, 1, 2, 2, -1, -1, -2, -2};
const int by[9] = {0, 2, -2, 1, -1, 2, -2, 1, -1};
int D[510];
inline int pow(int a, int b) {
  int nowans = 1;
  for (; b; b >>= 1, a = 1ll * a * a % 1000000007)
    if (b & 1) nowans = 1ll * nowans * a % 1000000007;
  return nowans;
}
int main() {
  scanf("%I64d%d", &k, &n);
  for (int i = 1, x, y; i <= n; i++) {
    scanf("%d%d", &x, &y);
    reflag[x + 1250][y + 1250] = -1;
  }
  int h = 0, l = 1;
  Q[l] = node(1250, 1250, 0);
  reflag[1250][1250] = 1;
  long long tmpk = k;
  k = min(k, 500ll);
  for (; h < l;) {
    ++h;
    if (h >= 4000000) h -= 4000000;
    int x = Q[h].x, y = Q[h].y, z = Q[h].z;
    if (z == k) continue;
    for (int i = 1; i <= 8; i++) {
      int newx = x + bx[i], newy = y + by[i];
      if (newx && newx <= 1250 * 2 && newy && newy <= 1250 * 2) {
        if (reflag[newx][newy] || (!(~reflag[newx][newy]))) continue;
        ++l;
        if (l >= 4000000) l -= 4000000;
        Q[l] = node(newx, newy, z + 1);
        reflag[newx][newy] = 1;
      }
    }
  }
  long long ans = 0;
  for (int i = 0; i <= 1250 * 2; i++)
    for (int j = 0; j <= 1250 * 2; j++) ans += reflag[i][j] == 1;
  for (int i = 1; i <= l; i++) ++D[Q[i].z];
  if (tmpk == k)
    printf("%d\n", ans);
  else {
    long long d = D[k];
    long long delta = D[k] - D[k - 1];
    tmpk -= k;
    tmpk %= 1000000007;
    ans = (ans + d * tmpk % 1000000007 +
           delta * tmpk % 1000000007 * (tmpk + 1) % 1000000007 * 1ll *
               pow(2, 1000000007 - 2) % 1000000007) %
          1000000007;
    printf("%I64d\n", ans);
  }
}
