#include <bits/stdc++.h>
using namespace std;
int main() {
  long int N, M;
  cin >> N >> M;
  vector<long long int> dp(N, 0);
  vector<bool> tf(N, true);
  for (long int i = 0; i < M; i++) {
    long int tmp;
    cin >> tmp;
    tf[tmp - 1] = false;
  }
  dp[0] = 1;
  dp[1] = 2;
  for (long int i = 2; i < N; i++) {
    if (tf[i]) {
      if (tf[i - 1] && tf[i - 2]) {
        dp[i] = dp[i - 1] + dp[i - 2];
      } else if ((tf[i - 2] == false) && tf[i - 1]) {
        dp[i] = dp[i - 1];
      } else if ((tf[i - 1] == false) && tf[i - 2]) {
        dp[i] = dp[i - 2];
      } else {
        cout << 0 << endl;
        return 0;
      }
    } else {
      dp[i] = 0;
    }
  }
  cout << dp[N - 1] % 1000000007 << endl;
  return 0;
}
