#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cstdio>
#define REP(i, n) for (int i = 0; i < (n); i++)
#define MOD 1000000007
 
 
using namespace std;
 
int main() {
    int N, M;
    long long count = 1;
    cin >> N >> M;
    int a[M];
    long long fib_array[N];
    fib_array[0] = 1;
    fib_array[1] = 1;
    for (int i = 2; i < N; i++) {
        fib_array[i] = (fib_array[i - 1] + fib_array[i - 2]) % MOD;
    }
    for (int i = 0; i < M; i++) {
        cin >> a[i];
        if (i == 0) {
            count = fib_array[a[0] - 1] % MOD;
        }
        else {
            if ((a[i] - a[i-1]) == 1) {
                count = 0;
                break;
            }
            else {
                count = (count * fib_array[(a[i] - a[i-1] - 2)]) % MOD;
            }
        }
    }
    cout << (count * fib_array[N - a[M - 1] - 1]) % MOD << endl;
}
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cstdio>
#define REP(i, n) for (int i = 0; i < (n); i++)
#define MOD 1000000007


using namespace std;

int main() {
    int N, M;
    long long count = 1;
    cin >> N >> M;
    int a[M];
    long long fib_array[N];
    fib_array[0] = 1;
    fib_array[1] = 1;
    for (int i = 2; i < N + M; i++) {
        fib_array[i] = (fib_array[i - 1] + fib_array[i - 2]) % MOD;
    }
    for (int i = 0; i < M; i++) {
        cin >> a[i];
        if (i == 0) {
            count = fib_array[a[0] - 1] % MOD;
        }
        else {
            if ((a[i] - a[i-1]) == 1) {
                count = 0;
                break;
            }
            else {
                count = (count * fib_array[(a[i] - a[i-1] - 2)]) % MOD;
            }
        }
    }
    cout << (count * fib_array[N - a[M - 1] - 1]) % MOD << endl;
}
