import java.util.*;

public class Main {
    static long steps[];
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        Set<Integer> a = new HashSet<Integer>(M);
        steps = new long[N+1];
        for(int i=1; i<=M; i++) {
            int tmp = sc.nextInt();
            a.add(tmp);
        }

        if(N<=1) {
            System.out.println(1L);
            return;
        }
        steps[0] = 1L;
        steps[1] = a.contains(1) ? 0L : 1L;
        for(int i=2; i<=N; i++) {
            steps[i] = a.contains(i) ? 0L : (steps[i-2] + steps[i-1]) % 1000000007L;
        }
        System.out.println(steps[N]);
    }
}
/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