#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
const int inf = 1000000007;
long long dp[10005];
long long fib(int n, vector<int> ok) {
  if (dp[n] != -1) return dp[n];
  if (ok[n])
    dp[n] = 0;
  else
    dp[n] = (fib(n - 1, ok) + fib(n - 2, ok)) % mod;
  return dp[n];
}
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(m);
  vector<int> ok(n + 1);
  for (int i = 0; i < (m); ++i) {
    cin >> a[i];
    ok[a[i]]++;
  }
  for (int i = 0; i < (10005); ++i) dp[i] = -1;
  dp[0] = 1;
  dp[1] = 1;
  long long res = fib(n, ok);
  cout << res << endl;
}
