#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
long long n, m;
long long dp[100000 + 10];
long long sum;
int main() {
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    int a;
    cin >> a;
    dp[a] = -inf;
  }
  dp[0] = -inf;
  for (int i = 0; i <= n; i++) {
    if (dp[i] == -inf) {
      if (dp[i + 1] == -inf) {
        if (i != 0) {
          cout << "0";
          return 0;
        } else {
          if (dp[2] == -inf) {
            cout << "0";
            return 0;
          } else {
            dp[2] = 1;
            dp[1] = 0;
            continue;
          }
        }
      } else {
        if (i != 0) {
          dp[i + 1] = dp[i - 1];
          dp[i] = 0;
          continue;
        } else {
          dp[1] = 1;
          dp[0] = 1;
          continue;
        }
      }
    }
    if (dp[i] == 1 || i == 1) {
      cout << i << " " << dp[i] << endl;
      continue;
    }
    dp[i] = dp[i - 2] + dp[i - 1];
    cout << i << " " << dp[i] << endl;
  }
  if (dp[n] == -inf)
    sum = dp[n - 1];
  else
    sum = dp[n];
  cout << sum % 1000000007;
  return 0;
}
