#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, m;
  cin >> n >> m;
  long long int a[m];
  for (long long int i = 0; i < m; i++) {
    cin >> a[i];
  }
  long long int dp[n + 1];
  for (long long int i = 0; i < n + 1; i++) {
    dp[i] = 0;
  }
  sort(a, a + m);
  dp[0] = 1;
  if (a[0] != 1) {
    dp[1] = 1;
  }
  if (a[0] != 2 && a[1] != 2) {
    dp[2] = dp[1] + dp[0];
  }
  long long int m1 = 0, m2 = 0;
  for (long long int i = 3; i <= n; i++) {
    long long int flag = 0;
    for (long long int j = 0; j < m; j++) {
      if (a[j] == (i)) {
        dp[i] = 0;
        flag = 1;
        continue;
      }
    }
    if (flag == 1) {
      continue;
    }
    m1 = (i - 1);
    m2 = (i - 2);
    flag = 0;
    for (long long int j = 0; j < m; j++) {
      if (a[j] == (m1)) {
        flag = 1;
        break;
      }
    }
    if (flag == 0) {
      dp[i] += dp[i - 1];
    }
    flag = 0;
    for (long long int j = 0; j < m; j++) {
      if (a[j] == (m2)) {
        flag = 1;
        break;
      }
    }
    if (flag == 0) {
      dp[i] += dp[i - 2];
    }
  }
  cout << (dp[n] % 1000000007) << endl;
}
