#include <bits/stdc++.h>
using namespace std;
int fib(int a) {
  int memo[100001];
  memo[0] = 1;
  memo[1] = 1;
  for (int i = 2; i <= a; i++) {
    memo[i] = memo[i - 1] + memo[i - 2];
  }
  return memo[a];
}
int main() {
  int N, M;
  cin >> N >> M;
  int a[100000], abc, b[100000];
  for (int i = 0; i < N; i++) a[i] = 1;
  for (int i = 0; i < M; i++) {
    cin >> abc;
    a[abc - 1] = 0;
  }
  int j = 0, count = 0;
  bool flag = false;
  for (int i = 0; i < N; i++) {
    if (a[i] == 0) {
      if (!flag) {
        b[j] = count;
        j++;
        flag = true;
        count = 0;
      } else {
        cout << 0;
        return 0;
      }
    } else {
      count++;
      flag = false;
    }
  }
  b[j] = count;
  j++;
  long long sum = 0L;
  for (int i = 0; i < j; i++) {
    if (i == 0)
      sum += fib(b[i]);
    else
      sum *= fib(b[i] - 1);
  }
  cout << sum % 1000000007;
}
