#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long lcm(long long a, long long b) { return a * b / gcd(a, b); }
vector<int> v;
int N, M;
void solve() {
  long long a = 1, b = 1, res = 0;
  int skip = 0;
  for (long long i = 1; i < N + 1; i++) {
    if (v.at(skip) == i) {
      res = 0;
      a = b;
      b = res % 1000000007;
      if (skip + 1 < M) skip++;
      continue;
    } else {
      if (i == 1) continue;
      res = a + b;
      a = b;
      b = res % 1000000007;
    }
  }
  cout << b % 1000000007 << endl;
}
void dfs(int i, int n, vector<int> data) {
  vector<int> v1, v2;
  copy((data).begin(), (data).end(), back_inserter(v1));
  copy((data).begin(), (data).end(), back_inserter(v2));
  if (i >= n) {
    if (!(i > n)) {
      for (int j = 0; j < data.size(); j++) {
        cout << data[j] << " ";
      }
      cout << endl;
    }
    return;
  }
  v1.push_back(i + 1);
  v2.push_back(i + 2);
  dfs(i + 1, n, v1);
  dfs(i + 2, n, v2);
}
int main() {
  cin >> N >> M;
  for (int i = 0; i < M; i++) {
    int x;
    cin >> x;
    v.push_back(x);
  }
  solve();
}
