#include <stdio.h>
#include <stdlib.h>

long int func(int n, int *a, int *b) {
    long int x;

    if (n == 1 && a[0] !=1)
        x = 1;
    else if (n == 1 && a[0] == 1)
        x = 0;
    else if (n == 2) {
        if (a[0] >= 3)  
            x = 2;
        else if (a[0] == 1 && a[1] >= 3)
            x = 1; 
        else if (a[0] == 2 || a[1] == 2)
            x = 0;
    }
    else {
        if (b[n] == 1)
            x = 0;
        else if (b[n-1] == 0 && b[n-2] == 0)
            x = func(n-1, a, b) + func(n-2, a, b);
        else if (b[n-1] == 0 && b[n-2] == 1) 
            x = func(n-1, a, b);
        else if (b[n-1] == 1 && b[n-2] == 0)
            x = func(n-2, a, b);
    }

    return x;
}

int main(void) {
    int n, m;
    int *a, *b;
    int i;
    long int x;
    int flag = 0;

    scanf("%d%d", &n, &m);

    a = calloc(m, sizeof(int));
    b = calloc(n, sizeof(int));

    for (i = 0; i < m; i++) {
        scanf("%d", &a[i]);
        b[a[i]] = 1;
    }

    for (i = 0; i < m; i++) {
        if (a[i]+1 == a[i+1]) {
            printf("0\n");
            flag += 1;
            break;
        }
    }

    if (flag == 0) {
        int x = func(n, a, b) % 1000000007;

        printf("%d\n", x);
    }

    return 0;
}