#include <bits/stdc++.h>
using namespace std;
vector<int> v;
int sum = 0;
int m = 0;
int n = 0;
int vector_finder(int number, int num) {
  int ret = 0;
  for (int i = 0; i < num; i++) {
    if (v[i] == number) {
      ret = 1;
    }
  }
  return ret;
}
void root(int n) {
  int a = 0;
  a = n;
  for (int i = 1; i <= 2; i++) {
    a -= 1;
    if (a == 0) {
      sum++;
      continue;
    }
    if (vector_finder(a, m) == 1) {
      continue;
    }
    if (a < 0) continue;
    root(a);
  }
}
int main() {
  int buf;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> buf;
    v.push_back(buf);
  }
  root(n);
  cout << sum % 1000000007;
}
