#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using db = double;
using pii = pair<int, int>;
using vi = vector<int>;
mt19937 mrand(time(0));
ll get(ll r) { return ((ll)mrand() * mrand() % r + r) % r; }
ll get(ll l, ll r) { return get(r - l + 1) + l; }
const int P = 1e9 + 7, D = 1500;
int dx[8] = {-1, 1, 2, 2, 1, -1, -2, -2};
int dy[8] = {-2, -2, -1, 1, 2, 2, 1, -1};
ll K;
int n, mp[3000][3000], cnt[1000];
ll val(ll l, ll n, ll d) {
  n %= P;
  ll r = l + (n - 1) * d;
  return (l + r) % P * n % P * 500000004 % P;
}
signed main() {
  scanf("%lld %d", &K, &n), K++;
  for (int i = 1, x, y; i <= n; i++)
    scanf("%d %d", &x, &y), mp[x + D][y + D] = 1e9;
  queue<pii> q;
  q.push(make_pair(D, D)), mp[D][D] = 1, cnt[1] = 1;
  while (q.size()) {
    pii nw = q.front();
    q.pop();
    if (mp[nw.first][nw.second] > 500) continue;
    for (int i = 0; i < 8; i++) {
      pii to = make_pair(nw.first + dx[i], nw.second + dy[i]);
      if (mp[to.first][to.second]) continue;
      mp[to.first][to.second] = mp[nw.first][nw.second] + 1;
      cnt[mp[to.first][to.second]]++, q.push(to);
    }
  }
  ll ans = 0;
  for (int i = 1; i <= min(K, 499ll); i++) ans += cnt[i];
  if (K < 500)
    printf("%lld\n", ans);
  else
    printf("%lld\n", (ans + val(cnt[500], K - 499, cnt[500] - cnt[499])) % P);
  fprintf(stderr, "time=%.4f\n", (db)clock() / CLOCKS_PER_SEC);
  return 0;
}
