#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
long long dp[100005];
bool broken[100005];
int main(void) {
  long long n, m;
  cin >> n >> m;
  long long a[m];
  for (int(i) = 0; (i) < (m); (i)++) {
    cin >> a[i];
    broken[a[i]] = true;
  }
  for (int(i) = 0; (i) < (m - 1); (i)++) {
    if (a[i] + 1 == a[i + 1]) {
      cout << 0 << endl;
      return 0;
    }
  }
  dp[1] = (broken[1] ? 0 : 1);
  dp[2] = (broken[2] ? 0 : (broken[1] ? 1 : 2));
  for (int i = 3; i <= n; i++) {
    if (broken[i]) {
      dp[i] = 0;
      continue;
    }
    dp[i] = dp[i - 1] + dp[i - 2];
  }
  cout << dp[n] % MOD << endl;
  return 0;
}
