#include <bits/stdc++.h>
using namespace std;
int n, m;
vector<int> br;
vector<long long> DP;
long long dp(int i) {
  if (i == n) return 1;
  if (i > n) return 0;
  if (br[i] == 1) return 0;
  if (DP[i] != -1) return DP[i];
  return DP[i] = (dp(i + 1) + dp(i + 2)) % 1000000007;
}
int main() {
  scanf("%d %d", &n, &m);
  br.resize(n + 1, 0);
  for (int i = 0; i < m; i++) {
    int a;
    scanf("%d", &a);
    br[a] = 1;
  }
  DP.resize(n + 1, -1);
  printf("%lld\n", dp(0));
  return 0;
}
