#include <bits/stdc++.h>
using namespace std;
const int N = 100, K = 40, P = 1e9 + 7;
int n, vis[222][222], dx[] = {1, 1, -1, -1, 2, 2, -2, -2},
                      dy[] = {2, -2, 2, -2, 1, -1, 1, -1}, cnt[K + 1], ans;
long long k;
queue<tuple<int, int, int>> q;
int main() {
  cin >> k >> n;
  for (int i = 0, x, y; i < n; i++) {
    cin >> x >> y;
    vis[x + N][y + N] = 1;
  }
  for (q.push({N, N, 0}), vis[N][N] = 1; q.size(); q.pop(), ans++) {
    auto [x, y, d] = q.front();
    for (int i = 0; i < 8; i++) {
      int nx = x + dx[i], ny = y + dy[i];
      if (!vis[nx][ny] && d < K && d < k) {
        vis[nx][ny] = 1;
        q.push({nx, ny, d + 1});
        cnt[d + 1]++;
      }
    }
  }
  if (k > K && cnt[K]) {
    k = (k - K + 1) % P;
    ans = (ans + cnt[K] * k % P +
           k * (k - 1) / 2 % P * (cnt[K] - cnt[K - 1]) % P - cnt[K] + P) %
          P;
  }
  cout << ans << endl;
}
