#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 7;
const long long mod = 1000000007;
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int get_bit(int x, int i) { return (x >> i) & 1; }
long long a[N], dp[N], b[N];
int main() {
  int n, m;
  cin >> n >> m;
  while (m--) {
    int x;
    cin >> x;
    b[x] = 1;
    dp[x] = 0;
  }
  int f = 0, kk = 0;
  for (int i = 1; i <= n; i++) {
    if (b[i] != 1 && f == 0) {
      dp[i] = 1;
      f = 1;
      continue;
    }
    if (f == 1 && b[i] != 1) {
      dp[i] = 2;
      kk = i;
      break;
    }
  }
  for (int i = kk + 1; i <= n; i++) {
    if (b[i] == 1) continue;
    dp[i] = (dp[i - 1] + dp[i - 2]) % mod;
  }
  cout << dp[n] << endl;
  return 0;
}
