#include <bits/stdc++.h>
using namespace std;
int calculateNthTermLoop(int n) {
  if (n < 0) {
    return -1;
  }
  long current = 0;
  long next = 1;
  for (int i = 0; i < n; i++) {
    long tmp = current;
    current = next;
    next += tmp;
  }
  return current;
}
int main() {
  int N, M, a[100005] = {}, sum = 0, mod = 1000000007;
  cin >> N >> M;
  bool flag = true;
  for (int i = 0; i < M; i++) {
    cin >> a[i];
  }
  if (M == 0) {
    sum = calculateNthTermLoop(N + 1);
  } else if (M == 1) {
    sum = calculateNthTermLoop(a[0]) + calculateNthTermLoop(N - a[0]);
  } else {
    for (int i = 0; i < M - 1; i++) {
      int X;
      X = a[i + 1] - a[i];
      if (X == 1) {
        flag = false;
        break;
      } else {
        int Y;
        Y = calculateNthTermLoop(X);
        sum = sum + Y;
        sum = sum % mod;
      }
    }
    sum = sum + calculateNthTermLoop(a[0]) + calculateNthTermLoop(N - a[0]);
    sum = sum % mod;
  }
  if (flag == false) {
    cout << 0 << endl;
  } else {
    cout << sum << endl;
  }
}
