#include <bits/stdc++.h>
using namespace std;
char alphz[27] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i',
                  'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r',
                  's', 't', 'u', 'v', 'w', 'x', 'y', 'z'};
long long MMIN(long long a, long long b) {
  if (a <= b)
    return a;
  else
    return b;
}
long long MMAX(long long a, long long b) {
  if (a >= b)
    return a;
  else
    return b;
}
float Euclidean(long long x1, long long x2, long long y1, long long y2) {
  return sqrt(pow(x1 - x2, 2) + pow(y1 - y2, 2));
}
long long gcd(long long a, long long b) {
  long long c;
  while (a != 0) {
    c = a;
    a = b % a;
    b = c;
  }
  return b;
}
int LCM(int a, int b) { return (a * b) / gcd(a, b); }
void PrimeFactor(long long n) {
  while (n % 2 == 0) {
    printf("%d ", 2);
    n /= 2;
  }
  for (int i = 3; i <= sqrt(n); i += 2) {
    if (n % i == 0) {
      printf("%d ", i);
      n /= i;
    }
  }
  if (n > 2) printf("%d ", n);
}
bool is_square(long long x) {
  long long l = 0, r = x;
  while (l <= r) {
    long long mid = l + (r - l) / 2;
    if (mid * mid == x) return true;
    if (mid * mid > x)
      r = mid - 1;
    else
      l = mid + 1;
  }
  return false;
}
bool is_Prime(int x) {
  if (x == 2)
    return 1;
  else if (x % 2 == 0 || x < 2)
    return 0;
  for (int i = 3; i * i <= x; i += 2)
    if (x % i == 0) return 0;
  return 1;
}
void dijjkstra(int src, int n) {
  list<pair<int, int>> adj[1000005];
  vector<bool> visited(1000005, false);
  vector<int> dis(1000005, 1e9);
  priority_queue<pair<int, int>, vector<pair<int, int>>,
                 greater<pair<int, int>>>
      pq;
  pq.push(make_pair(0, 1));
  dis[src] = 0;
  while (!pq.empty()) {
    int u = pq.top().second;
    visited[u] = true;
    pq.pop();
    list<pair<int, int>>::iterator i;
    for (i = adj[u].begin(); i != adj[u].end(); i++) {
      int v = i->first;
      int we = i->second;
      if (!visited[v] && dis[v] > dis[u] + we) {
        dis[v] = dis[u] + we;
        pq.push(make_pair(dis[v], v));
      }
    }
  }
}
const int N = 1e+5;
int dp[N];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  cin >> n >> m;
  vector<int> a(m);
  dp[0] = 1;
  dp[1] = 1;
  for (int i = 0; i < m; i++) {
    cin >> a[i];
    dp[a[i]] = 0;
  }
  for (int i = 1; i <= n; i++) {
    if (dp[i] == 0)
      continue;
    else if (i >= 2)
      dp[i] = (dp[i - 1] + dp[i - 2]) % 1000000007;
  }
  cout << dp[n] << '\n';
  return 0;
}
