#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
const double eps = 1e-6;
int read() {
  char ch = getchar();
  int x = 0;
  while (ch > '9' || ch < '0') ch = getchar();
  while (ch <= '9' && ch >= '0') x = x * 10 + ch - '0', ch = getchar();
  return x;
}
int n, m;
long long dp[100005];
bool broken[100005];
long long dfs(int step) {
  if (dp[step] != -1)
    return dp[step];
  else if (broken[step])
    return dp[step] = 0;
  else
    return dp[step] =
               (dfs(step - 1) % 1000000007 + dfs(step - 2) % 1000000007) %
               1000000007;
}
int main() {
  dp[1] = 1;
  dp[2] = 2;
  memset(dp, -1, sizeof(dp));
  memset(broken, 0, sizeof(broken));
  n = read(), m = read();
  for (int i = 1; i <= m; i++) {
    int c = read();
    broken[c] = 1;
  }
  if (broken[1] == 1) {
    dp[1] = 0;
    dp[2] = 1;
  }
  if (broken[2] == 1) dp[2] = 0;
  if (broken[1] == 1 && broken[2] == 1) {
    cout << 0;
    return 0;
  }
  long long ans = dfs(n) % 1000000007;
  cout << ans;
  return 0;
}
