#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007LL;
long long k;
int n;
int dx[] = {2, 2, -2, -2, 1, 1, -1, -1};
int dy[] = {1, -1, 1, -1, 2, -2, 2, -2};
long long arithm(long long a, long long b, long long n) {
  long long s1 = a + b;
  long long s2 = n;
  if (s1 % 2 == 0)
    s1 /= 2;
  else
    s2 /= 2;
  s1 %= mod;
  s2 %= mod;
  return (s1 * s2) % mod;
}
int main() {
  cin >> k >> n;
  set<pair<int, int> > bad;
  for (int i = 0; i < n; ++i) {
    int x, y;
    cin >> x >> y;
    bad.insert(make_pair(x, y));
  }
  queue<pair<int, int> > q;
  map<pair<int, int>, int> d;
  q.push(make_pair(0, 0));
  d[make_pair(0, 0)] = 0;
  int pdiff = -1;
  int prev = -1000000;
  long long total = 0;
  for (long long i = 0; i <= k; ++i) {
    long long cur = 0;
    while (!q.empty()) {
      pair<int, int> t = q.front();
      if (d[t] != i) {
        break;
      }
      ++cur;
      ++total;
      q.pop();
      for (int j = 0; j < 8; ++j) {
        int nx = t.first + dx[j], ny = t.second + dy[j];
        if (!d.count(make_pair(nx, ny)) && !bad.count(make_pair(nx, ny))) {
          d[make_pair(nx, ny)] = d[t] + 1;
          q.push(make_pair(nx, ny));
        }
      }
    }
    if (i > 100 && cur - prev == pdiff) {
      long long buf = (k - i) % mod;
      long long res = total + arithm(cur + pdiff, cur + buf * pdiff, k - i);
      cout << res % mod << endl;
      return 0;
    }
    pdiff = cur - prev;
    prev = cur;
  }
  cout << total << endl;
  return 0;
}
