#include <bits/stdc++.h>
using namespace std;
set<pair<int, int> > vis;
int mx[8] = {-2, -2, -1, -1, 1, 1, 2, 2};
int my[8] = {-1, 1, -2, 2, -2, 2, -1, 1};
int main() {
  long long K;
  int N;
  cin >> K >> N;
  for (int i = 0; i < N; i++) {
    int x, y;
    cin >> x >> y;
    vis.insert(pair<int, int>(x, y));
  }
  int i = 0;
  vector<pair<int, int> > cur;
  cur.push_back(pair<int, int>(0, 0));
  vis.insert(pair<int, int>(0, 0));
  int pinc, ppinc;
  for (i = 0; i < 100 && i < K; i++) {
    vector<pair<int, int> > nxt;
    for (int j = 0; j < cur.size(); j++) {
      int cx = cur[j].first, cy = cur[j].second;
      for (int m = 0; m < 8; m++) {
        int nx = cx + mx[m], ny = cy + my[m];
        pair<int, int> t(nx, ny);
        if (!vis.count(t)) {
          vis.insert(t);
          nxt.push_back(t);
        }
      }
    }
    cur = nxt;
    ppinc = pinc;
    pinc = nxt.size();
  }
  const int md = 1000000007;
  long long num = (K - i);
  long long dif = pinc - ppinc;
  num %= md;
  dif %= md;
  long long a = pinc + num * dif + pinc + dif;
  if (a % 2 == 0) {
    a /= 2;
  } else {
    num /= 2;
  }
  a %= md;
  num %= md;
  cout << (vis.size() - N + a * num) % md;
}
