#include <bits/stdc++.h>
using namespace std;
int fib(int flr, int cel) {
  if (flr == cel) {
    return 1;
  }
  cel -= flr;
  flr = 0;
  int a, b, ans;
  a = 1;
  b = 1;
  ans = b;
  for (int i = flr + 2; i <= cel; i++) {
    ans = a + b;
    a = b;
    b = ans;
  }
  return ans;
}
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> a(M);
  for (int i = 0; i < M; i++) {
    cin >> a[i];
  }
  if (M == 0) {
    int anselse = fib(0, N);
    cout << anselse << endl;
    return 0;
  }
  if (M != 0) {
    int bef = a[0];
    for (int i = 1; i < M; i++) {
      if (a[i] == bef + 1) {
        cout << 0 << endl;
        return 0;
      }
      bef = a[i];
    }
  }
  vector<int> anss;
  int flr = 0;
  int cel;
  for (int i = 0; i < M; i++) {
    cel = a[i] - 1;
    int ptn = fib(flr, cel);
    anss.push_back(ptn);
    flr = a[i] + 1;
  }
  cel = N;
  int ptnlst = fib(flr, cel);
  anss.push_back(ptnlst);
  unsigned long long ans = 1;
  for (int i = 0; i < anss.size(); i++) {
    ans *= anss[i];
  }
  ans %= 1000000007;
  cout << ans << endl;
  return 0;
}
