#include <bits/stdc++.h>
using namespace std;
const int N = 100, k = 40, MOD = 1e9 + 7;
queue<pair<pair<int, int>, int> > q;
int vis[210][210];
int dx[8] = {1, 1, 2, 2, -1, -1, -2, -2};
int dy[8] = {2, -2, 1, -1, 2, -2, 1, -1};
int cnt[45];
long long m;
int n;
int ans;
inline int mo(int x) {
  if (x >= MOD) return x - MOD;
  return x;
}
int main() {
  scanf("%lld%d", &m, &n);
  for (int i = 0; i < n; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    vis[x + N][y + N] = 1;
  }
  q.push(make_pair(make_pair(N, N), 0));
  vis[N][N] = 1;
  while (q.size()) {
    int x = q.front().first.first, y = q.front().first.second,
        z = q.front().second + 1;
    q.pop();
    ans++;
    if (z > k || z > m) continue;
    for (int w = 0; w < 8; w++) {
      int xx = x + dx[w], yy = y + dy[w];
      if (vis[xx][yy]) continue;
      cnt[z]++;
      vis[xx][yy] = 1;
      q.push(make_pair(make_pair(xx, yy), z));
    }
  }
  if (m > k && cnt[k]) {
    m = (m - k) % MOD;
    ans = mo(mo(ans + 1ll * cnt[k] * m % MOD) +
             1ll * m * (m + 1) / 2 % MOD * mo(cnt[k] - cnt[k - 1] + MOD) % MOD);
  }
  printf("%d\n", ans);
}
