import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        int[] holeIndices = new int[M];

        for (int i=0; i<M; i++) {
            holeIndices[i] = sc.nextInt() - 1;
        }

        boolean[] holes = new boolean[N];
        for (int i=0; i<N; i++) {
            holes[i] = false;
        }
        for (int index : holeIndices) {
            holes[index] = true;
        }

        if (holes[0] && holes[1]) {
            System.out.println(0);
            return;
        }

        List<Integer> dp = new ArrayList<>();
        dp.add(1);
        if (!holes[0]) {
            dp.add(2);
        } else {
            dp.add(1);
        }

        for (int i=2; i<N; i++) {
            if (holes[i]) {
                if (holes[i-1]) {
                    System.out.println(0);
                    return;
                } else {
                    dp.add(dp.get(i-1));
                }
            } else {
                if (!holes[i-1] && !holes[i-2]) {
                    dp.add((dp.get(i-1) + dp.get(i-2)) % 1000000007);
                } else {
                    dp.add(dp.get(i-1));
                }
            }
        }
        System.out.println(dp.get(N-1));
    }
}


/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz