#include <bits/stdc++.h>
using namespace std;
using Edge = pair<int, int>;
using Graph = vector<vector<Edge>>;
using pll = pair<long long, long long>;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class A>
void pr(A a) {
  cout << a;
  cout << '\n';
}
template <class A, class B>
void pr(A a, B b) {
  cout << a << ' ';
  pr(b);
}
template <class A, class B, class C>
void pr(A a, B b, C c) {
  cout << a << ' ';
  pr(b, c);
}
template <class A, class B, class C, class D>
void pr(A a, B b, C c, D d) {
  cout << a << ' ';
  pr(b, c, d);
}
template <class A>
void PR(A a, long long n) {
  for (int i = 0; i < (n); ++i) {
    if (i) cout << ' ';
    cout << a[i];
  }
  cout << '\n';
}
int GCD(int a, int b) { return b ? GCD(b, a % b) : a; }
const long long INF = 1LL << 60;
const long long MOD = 1000000007;
pair<pair<string, int>, int> p[110];
int main() {
  int N, M;
  cin >> N >> M;
  long long dp[10010] = {0};
  queue<int> a;
  for (int i = 0; i < (M); ++i) {
    int A;
    cin >> A;
    a.push(A);
  }
  dp[0] = 0;
  if (a.front() == 1) {
    dp[1] = 0;
    dp[2] = 1;
    a.pop();
  } else {
    dp[1] = 1;
    dp[2] = 2;
  }
  if (a.front() == 2) {
    a.pop();
  }
  for (int i = 3; i < N + 1; i++) {
    if (a.front() == i) {
      dp[i] = 0;
      a.pop();
    } else {
      dp[i] = (dp[i - 1] + dp[i - 2]) % MOD;
    }
  }
  cout << dp[N] << endl;
}
