#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<long long int> dp(n);
  dp[0] = 0;
  dp[1] = 1;
  dp[2] = 2;
  int hoge;
  vector<int> step(m);
  for (int i = 0; i < m; i++) {
    cin >> hoge;
    step[m] = hoge;
  }
  int f1 = 1, f2 = 1;
  for (int i = 3; i < n; i++) {
    if (binary_search(step.begin(), step.end(), dp[i - 1])) {
      f1 = 0;
    }
    if (binary_search(step.begin(), step.end(), dp[i - 2])) {
      f2 = 0;
    }
    dp[i] = (dp[i - 1] * f1 + dp[i - 2] * f2 * 2) % 1000000007;
    f1 = 1;
    f2 = 2;
  }
  cout << dp[n - 1] << endl;
}
