#include <bits/stdc++.h>
using namespace std;
ifstream fin("input.txt");
ofstream fout("output.txt");
int gcd(int a, int b) {
  while (a && b) a > b ? a %= b : b %= a;
  return a + b;
}
long long pows(int a, int b) {
  long long res = 1;
  for (int i = 0; i < b; ++i) {
    res *= a;
  }
  return res;
}
long long logx(long long base, long long num) {
  int cnt = 0;
  while (num != 1) {
    num /= base;
    ++cnt;
  }
  return cnt;
}
long long divisibles(long long a, long long b, long long m) {
  if (a % m == 0)
    return (b / m) - (a / m) + 1;
  else
    return (b / m) - (a / m);
}
vector<int> vis(100001, 0);
vector<int> adj[100001];
int main() {
  std::ios::sync_with_stdio(false);
  long long n, m;
  cin >> n >> m;
  vector<long long> vec(100001, -1);
  vec[1] = 1;
  vec[2] = 2;
  for (int i = 0; i < m; ++i) {
    int x;
    cin >> x;
    vec[x] = 0;
  }
  for (int i = 3; i <= n; ++i) {
    if (vec[i] == -1) vec[i] = (vec[i - 1] + vec[i - 2]) % 1000000007;
  }
  cout << vec[n] << "\n";
}
