#include <bits/stdc++.h>
using namespace std;
int countStep(int n, int current) {
  if (current == n) {
    return 1;
  }
  if (current > n) {
    return 0;
  }
  return countStep(n, current + 1) + countStep(n, current + 2);
}
int main() {
  int n, m;
  bool check = true;
  cin >> n >> m;
  vector<unsigned long long int> step(n + 1, 0);
  step[0] = 1;
  step[1] = 1;
  for (int i = 2, k = -1; i < n + 1; i++) {
    if (check && m != 0) {
      m--;
      cin >> k;
      if (k == 1) {
        step[1] = 0;
        cin >> k;
        m--;
      }
    }
    if (i == k) {
      step[i] = 0;
      check = true;
    } else {
      step[i] = step[i - 1] + step[i - 2];
      check = false;
    }
  }
  cout << step[n] % 1000000007 << endl;
}
