#include <bits/stdc++.h>
using namespace std;
const int OX = 200, OY = 200, T = 50;
const int dx[8] = {1, 2, -1, -2, -2, -1, 1, 2};
const int dy[8] = {2, 1, 2, 1, -1, -2, -2, -1};
const long long MOD = 1000000000 + 7;
int n, dep[4 * OX][4 * OY], cnt[T + 10];
queue<pair<int, int> > q;
long long k;
int main() {
  scanf("%I64d%d", &k, &n);
  int x, y;
  for (int i = 1; i <= n; i++) {
    scanf("%d%d", &x, &y);
    dep[x + OX][y + OY] = -1;
  }
  dep[0 + OX][0 + OY] = 1;
  cnt[1]++;
  q.push({0 + OX, 0 + OY});
  int xx, yy;
  long long ted = 1;
  while (!q.empty()) {
    x = q.front().first;
    y = q.front().second;
    q.pop();
    if (dep[x][y] > k || dep[x][y] > T) continue;
    for (int i = 0; i < 8; i++) {
      xx = x + dx[i], yy = y + dy[i];
      if (!dep[xx][yy]) {
        dep[xx][yy] = dep[x][y] + 1;
        cnt[dep[xx][yy]]++;
        ++ted;
        q.push({xx, yy});
      }
    }
  }
  if (k <= T || cnt[T + 1] == 0)
    printf("%I64d\n", ted);
  else {
    long long z = k - T, w = z + 1, rem = z % MOD;
    if (z % 2)
      w /= 2LL;
    else
      z /= 2LL;
    z %= MOD;
    w %= MOD;
    long long ans = (z * w % MOD) * 28 % MOD;
    ans = (ans + rem * cnt[T + 1] % MOD) % MOD;
    ans = (ans + ted) % MOD;
    printf("%I64d\n", ans);
  }
  return 0;
}
