#include <bits/stdc++.h>
using namespace std;
const int INF = int(1e9);
long long int memo[100000];
long long int dfs(int x) {
  if (x < 0) return 0;
  if (x == 0) return 1;
  if (memo[x] == 0) memo[x] = dfs(x - 1) + dfs(x - 2);
  return memo[x];
}
int main() {
  int N, M;
  cin >> N >> M;
  bool stair[N + 1];
  for (int i = 0; i < (int)(N + 1); i++) stair[i] = true;
  for (int i = 0; i < M; ++i) {
    int a;
    cin >> a;
    stair[a] = false;
  }
  long long int ans = 1;
  int count = 0;
  for (int i = 0; i < N + 1; ++i) {
    if (stair[i] == false) {
      ans = (ans * dfs(count - 1)) % 1000000007;
      count = 0;
    } else {
      count += 1;
    }
  }
  ans = (ans * dfs(count - 1)) % 1000000007;
  cout << ans;
}
