#include <bits/stdc++.h>
using namespace std;
long long k;
int n;
int dist[500][500];
int cnt[1000] = {};
queue<pair<int, int> > q;
int dx[8] = {1, 1, -1, -1, 2, 2, -2, -2};
int dy[8] = {2, -2, 2, -2, 1, -1, 1, -1};
const int MOD = 1e9 + 7;
int binPow(long long x, int p) {
  long long ret = 1;
  while (p) {
    if (p & 1) ret = ret * x % MOD;
    p >>= 1;
    x = x * x % MOD;
  }
  return (int)ret;
}
int main() {
  scanf("%I64d%d", &k, &n);
  for (int i = 0; i < (int)(500); ++i)
    for (int j = 0; j < (int)(500); ++j) dist[i][j] = -1;
  for (int i = 0; i < (int)(n); ++i) {
    int y, x;
    scanf("%d%d", &y, &x), y += 250, x += 250;
    dist[y][x] = -2;
  }
  dist[250][250] = 0;
  ++cnt[0];
  q.push(make_pair(250, 250));
  int rem = 0;
  while (!q.empty()) {
    int y = q.front().first;
    int x = q.front().second;
    rem = dist[y][x];
    if (y > 490 || x > 490 || y < 10 || x < 10) {
      break;
    }
    q.pop();
    int curD = dist[y][x] + 1;
    for (int i = 0; i < (int)(8); ++i) {
      int yy = y + dy[i];
      int xx = x + dx[i];
      if (dist[yy][xx] == -1) {
        ++cnt[dist[yy][xx] = curD];
        q.push(make_pair(yy, xx));
      }
    }
  }
  int tot = 0;
  if (q.empty() || k <= rem) {
    rem = min((long long)rem + 1, k);
    for (int i = 0; i < (int)(rem + 1); ++i) tot += cnt[i];
    printf("%d\n", tot);
    return 0;
  }
  for (int i = 0; i < (int)(rem + 1); ++i) tot += cnt[i];
  long long from = cnt[rem] + 28;
  long long to = cnt[rem] + (k - rem) % MOD * 28 % MOD;
  long long ccnt = (k - rem) % MOD;
  int res = (tot + (from + to) * ccnt % MOD * binPow(2, MOD - 2)) % MOD;
  printf("%d\n", res);
  return 0;
}
