#include <bits/stdc++.h>
using namespace std;
long long n, m, a[101010];
long long dp[101010] = {0};
long long fib(int c) {
  if (c <= 1) return 1;
  if (dp[c] != 0) return dp[c];
  dp[c] = fib(c - 1) + fib(c - 2);
  return dp[c];
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> a[i];
  }
  a[m] = n + 1;
  long long cnt = 1;
  int now = 0;
  for (int i = 0; i <= m; i++) {
    if (a[i] < now) continue;
    if (a[i] == now) cnt = 0;
    cnt *= fib(a[i] - now - 1) % 1000000007;
    now = a[i] + 1;
    cnt %= 1000000007;
  }
  cout << cnt << endl;
  return 0;
}
