import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.*;
public class Main { //atcoder ABC128C -

	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer(br.readLine());
		int n = Integer.parseInt(st.nextToken());
		int m = Integer.parseInt(st.nextToken());
		boolean[] arr = new boolean[n+1];
		long[] count = new long[n+1];
		for(int i = 0; i < m; i++){
			int a = Integer.parseInt(br.readLine());
			arr[a] = true;
		}
		count[0] = 1;
		count[1] = arr[1] ? 0 : 1;
		for(int i = 2; i <= n; i++){
			if(!arr[i]) {
				count[i] = (count[i-1] + count[i-2]) % 1000000007;
			}
		}
		System.out.println(count[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