#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  int a[M];
  vector<int> dp(N, 1);
  for (int i = 0; i < M; i++) {
    cin >> a[i];
    a[i]--;
    dp[a[i]] = -1;
  }
  int count = 0;
  for (int i = 0; i < N; i++) {
    if (dp[i] != -1) {
      dp[i] = count;
      count++;
      if (count == 2) {
        break;
      }
    }
  }
  for (int i = 0; i < N - 1; i++) {
    if (dp[i] == -1 && dp[i + 1] == -1) {
      cout << 0 << endl;
      return 0;
    }
  }
  for (int i = 0; i < N; i++) {
    if (dp[i] != -1) {
      if (dp[i - 1] != -1 && i - 1 >= 0)
        dp[i] = (dp[i] + dp[i - 1]) % 1000000007;
      if (dp[i - 2] != -1 && i - 2 >= 0)
        dp[i] = (dp[i] + dp[i - 2]) % 1000000007;
    }
  }
  cout << dp[N - 2] % 1000000007 + 1 << endl;
}
