#include <bits/stdc++.h>
using namespace std;
int dy[] = {0, 0, 1, -1, 0};
int dx[] = {1, -1, 0, 0, 0};
int main() {
  long long N, M;
  cin >> N >> M;
  int a;
  vector<int> b(N, 1);
  b[N - 1] = 0;
  for (int i = 0; i < M; i++) {
    cin >> a;
    b[a - 1] -= 10;
    if (a > 1) b[a - 2] -= 1;
    if (a < N) b[a] -= 1;
  }
  long long ans, co = 0;
  vector<long long> dp(N);
  dp[0] = 1;
  dp[1] = 2;
  for (int i = 2; i < N; i++) {
    dp[i] = dp[i - 1] + dp[i - 2];
  }
  int t = 0;
  ans = 1;
  for (int i = 0; i < N; i++) {
    if (b[i] < -9) {
      cout << 0 << endl;
      return 0;
    } else if (b[i] == 1) {
      t++;
    } else {
      ans = ans * dp[t] % 1000000007;
      t = 0;
    }
  }
  cout << ans << endl;
  return 0;
}
