#include <bits/stdc++.h>
using namespace std;
struct node {
  long long x, y, p;
};
inline long long read() {
  long long x = 0, w = 0;
  char ch = getchar();
  while (!isdigit(ch)) w |= ch == '-', ch = getchar();
  while (isdigit(ch)) x = (x << 1) + (x << 3) + ch - '0', ch = getchar();
  return w ? -x : x;
}
long long dx[] = {-1, -1, 1, 1, -2, -2, 2, 2},
          dy[] = {-2, 2, -2, 2, -1, 1, -1, 1}, k, n, ans = 1, c[400000],
          a[4000][4000];
inline void bfs(long long k) {
  queue<node> q;
  q.push(node{1500, 1500, 0});
  while (!q.empty()) {
    long long x = q.front().x, y = q.front().y, p = q.front().p;
    q.pop();
    if (k == p) break;
    for (long long i = 0; i < 8; ++i) {
      long long xx = dx[i] + x, yy = dy[i] + y;
      if (a[xx][yy] == 0) {
        q.push({xx, yy, p + 1});
        a[xx][yy] = 1;
        ++ans;
        ++c[p + 1];
      }
    }
  }
}
signed main() {
  long long k = read(), n = read();
  for (long long i = 1; i <= n; ++i) {
    long long x = read(), y = read();
    a[x + 1500][y + 1500] = 1;
  }
  c[0] = 1;
  a[1500][1500] = 1;
  if (k <= 500) {
    bfs(k);
    cout << ans;
  } else {
    bfs(500);
    k = (k - 499) % 1000000007;
    cout << ((ans + (k - 1) * c[500] % 1000000007) % 1000000007 +
             (k - 1) * k / 2 % 1000000007 * ((c[500] - c[499]) + 1000000007) %
                 1000000007) %
                1000000007;
  }
  return 0;
}
