#include <bits/stdc++.h>
using namespace std;
const long long Mod = 1000000007;
struct node {
  int x, y;
};
int dx[8] = {1, 1, -1, -1, 2, 2, -2, -2};
int dy[8] = {2, -2, -2, 2, 1, -1, -1, 1};
queue<node> q;
long long mp[3000][3000], k, n, ans[610];
void bfs(int x, int y) {
  q.push({x, y});
  mp[x][y] = 1;
  while (!q.empty()) {
    node u = q.front();
    q.pop();
    ans[mp[u.x][u.y]]++;
    if (mp[u.x][u.y] > 500) break;
    for (int i = 0; i < 8; i++) {
      int nx = u.x + dx[i], ny = u.y + dy[i];
      if (mp[nx][ny]) continue;
      mp[nx][ny] = mp[u.x][u.y] + 1;
      q.push({nx, ny});
    }
  }
}
int main() {
  cin >> k >> n;
  for (int i = 1, x, y; i <= n; i++) {
    cin >> x >> y;
    x += 1001, y += 1001;
    mp[x][y] = 1;
  }
  bfs(1001, 1001);
  long long Ans = 0;
  if (k < 500) {
    for (int i = 1; i <= k + 1; i++) Ans = (Ans + ans[i]) % Mod;
  } else {
    long long del = ans[500] - ans[499];
    k = (k - 498) % Mod;
    for (int i = 0; i <= 499; i++) Ans = (Ans + ans[i]) % Mod;
    Ans = (((k * ans[500] % Mod + Ans) % Mod +
            (k * (k - 1) >> 1) % Mod * del % Mod) %
               Mod +
           Mod) %
          Mod;
  }
  cout << Ans << endl;
  return 0;
}
