#include <bits/stdc++.h>

using namespace std;

using ll = long long;

int main(){
    ll n, m;
    cin >> n >> m;
    ll arr[n] = {0}, arr1[n] = {0};
    arr1[0] = 1;
    arr1[1] = 1;
    for(ll i = 0; i < m; ++i){
        ll tmp; cin >> tmp;
        arr[tmp] = -1;

    }
    for(ll i = 0; i < n; ++i){
        if(arr[i] == arr[i + 1] && arr[i] == -1){
            cout << 0;
            return 0;
        }
    }
    for(ll i = 2; i < n; ++i){
        arr1[i - 1] %= 1000000007;
        arr1[i - 2] %= 1000000007;
        arr1[i] += arr1[i - 1] + arr1[i - 2];
        arr1[i] %= 1000000007;
        if(arr[i - 1] == -1){
            arr1[i] -= arr1[i - 1];
        }
        if(arr[i - 2] == -1){
            arr1[i] -= arr1[i - 2];
        }
    }
    cout << (arr1[n - 1] + arr1[n - 2]) % 1000000007;
    return 0;
}
