#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef pair<int,int> pp;
const int INF = 1e9;
const int MOD = 1000000007;
const double pi = 3.141592653589793238;

ll gcd(ll a, ll b) { return __gcd(a,b); } //最大公約数
ll lcm(ll a, ll b) { return a/gcd(a,b)*b; } //最大公倍数

template<class T> inline bool chmin(T& a, T b) { if (a > b) {a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) {a = b; return true; } return false; }

int main() {
  int N, M;
  cin >> N >> M;

  vector<bool> h(N, true);
  for(int i = 0; i < M; i++) {
    int a;cin >> a;
    h.at(a) = false;
  }

  vector<int> dp(N+1, 0);
  dp[0] = 1;
  if(h.at(1)) dp[1] = 1;
  for(int i = 2; i <= N; i++) {
    if(h.at(i-1)) dp[i] += dp[i-1];
    if(h.at(i-2)) dp[i] += dp[i-2];
    dp[i] %= MOD;
  }

  cout << dp[N] << endl;

  return 0;
}
