#include <bits/stdc++.h>
using namespace std;
int main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  int s;
  int a[m];
  int key1 = 0;
  for (int i = 0; i < m; i++) {
    cin >> s;
    a[i] = s;
    if (s == 1) {
      key1 = 1;
    }
  }
  unsigned long long dp[100100] = {0};
  int key, tmp = 0;
  dp[0] = 1;
  for (int i = 1; i < n + 1; i++) {
    if (i == 1 and key1 == 1) {
      dp[1] += 1;
    } else {
      key = 0;
      for (int j = tmp; j < m; j++) {
        if (i == a[j]) {
          key = 1;
          tmp = j;
          break;
        }
      }
      if (key == 0) {
        dp[i] += dp[i - 1];
        dp[i] += dp[i - 2];
      }
    }
  }
  cout << dp[n] % 1000000007 << endl;
  return 0;
}
