
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

	public static int N;
	public static int[] stair;
	public static long[] count;

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		N = sc.nextInt();
		int M = sc.nextInt();
		List<Integer> broken = new ArrayList<>();
		boolean impossible = false;
		int tmp = -1;
		stair = new int[N + 1];
		count = new long[N + 1];
		for(int i = 0; i < N + 1; i++) {
			stair[i] = 0;
		}
		for(int i = 1; i < M + 1; i++) {
			int tmp2 = sc.nextInt();
			if(tmp + 1 == tmp2) {
				impossible = true;
				break;
			} else {
				stair[tmp2] = 1;
				tmp = tmp2;
			}
		}
		if(!impossible) {
			for(int i = 0; i < N + 1; i++) {
				count[i] = 0;
			}
			count[N] = 1;
			for(int i = N; i > 0; i--) {
				if(i > 1) {
					if(stair[i - 1] == 0) {
						count[i - 1] += count[i] % 1000000007;
					}
					if(stair[i - 2] == 0) {
						count[i - 2] += count[i] % 1000000007;
					}
				} else if(i == 1) {
					count[0] += count[i] % 1000000007;
				}
			}
			System.out.println(count[0] % 1000000007);
		} else {
			System.out.println(0);
		}
	}
} import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util import java.util.Scanner; Scanner java.util public class Main {

	public static int N;
	public static int[] stair;
	public static long[] count;

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		N = sc.nextInt();
		int M = sc.nextInt();
		List<Integer> broken = new ArrayList<>();
		boolean impossible = false;
		int tmp = -1;
		stair = new int[N + 1];
		count = new long[N + 1];
		for(int i = 0; i < N + 1; i++) {
			stair[i] = 0;
		}
		for(int i = 1; i < M + 1; i++) {
			int tmp2 = sc.nextInt();
			if(tmp + 1 == tmp2) {
				impossible = true;
				break;
			} else {
				stair[tmp2] = 1;
				tmp = tmp2;
			}
		}
		if(!impossible) {
			for(int i = 0; i < N + 1; i++) {
				count[i] = 0;
			}
			count[N] = 1;
			for(int i = N; i > 0; i--) {
				if(i > 1) {
					if(stair[i - 1] == 0) {
						count[i - 1] += count[i] % 1000000007;
					}
					if(stair[i - 2] == 0) {
						count[i - 2] += count[i] % 1000000007;
					}
				} else if(i == 1) {
					count[0] += count[i] % 1000000007;
				}
			}
			System.out.println(count[0] % 1000000007);
		} else {
			System.out.println(0);
		}
	}
} Main public static int N; N public static int[] stair; stair public static long[] count; count public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		N = sc.nextInt();
		int M = sc.nextInt();
		List<Integer> broken = new ArrayList<>();
		boolean impossible = false;
		int tmp = -1;
		stair = new int[N + 1];
		count = new long[N + 1];
		for(int i = 0; i < N + 1; i++) {
			stair[i] = 0;
		}
		for(int i = 1; i < M + 1; i++) {
			int tmp2 = sc.nextInt();
			if(tmp + 1 == tmp2) {
				impossible = true;
				break;
			} else {
				stair[tmp2] = 1;
				tmp = tmp2;
			}
		}
		if(!impossible) {
			for(int i = 0; i < N + 1; i++) {
				count[i] = 0;
			}
			count[N] = 1;
			for(int i = N; i > 0; i--) {
				if(i > 1) {
					if(stair[i - 1] == 0) {
						count[i - 1] += count[i] % 1000000007;
					}
					if(stair[i - 2] == 0) {
						count[i - 2] += count[i] % 1000000007;
					}
				} else if(i == 1) {
					count[0] += count[i] % 1000000007;
				}
			}
			System.out.println(count[0] % 1000000007);
		} else {
			System.out.println(0);
		}
	} main {
		Scanner sc = new Scanner(System.in);
		N = sc.nextInt();
		int M = sc.nextInt();
		List<Integer> broken = new ArrayList<>();
		boolean impossible = false;
		int tmp = -1;
		stair = new int[N + 1];
		count = new long[N + 1];
		for(int i = 0; i < N + 1; i++) {
			stair[i] = 0;
		}
		for(int i = 1; i < M + 1; i++) {
			int tmp2 = sc.nextInt();
			if(tmp + 1 == tmp2) {
				impossible = true;
				break;
			} else {
				stair[tmp2] = 1;
				tmp = tmp2;
			}
		}
		if(!impossible) {
			for(int i = 0; i < N + 1; i++) {
				count[i] = 0;
			}
			count[N] = 1;
			for(int i = N; i > 0; i--) {
				if(i > 1) {
					if(stair[i - 1] == 0) {
						count[i - 1] += count[i] % 1000000007;
					}
					if(stair[i - 2] == 0) {
						count[i - 2] += count[i] % 1000000007;
					}
				} else if(i == 1) {
					count[0] += count[i] % 1000000007;
				}
			}
			System.out.println(count[0] % 1000000007);
		} else {
			System.out.println(0);
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) N = sc.nextInt() N sc.nextInt() sc.nextInt sc int M = sc.nextInt(); M sc.nextInt() sc.nextInt sc List<Integer> broken = new ArrayList<>(); broken new ArrayList<>() boolean impossible = false; impossible false int tmp = -1; tmp -1 1 stair = new int[N + 1] stair new int[N + 1] N + 1 N 1 count = new long[N + 1] count new long[N + 1] N + 1 N 1 for(int i = 0; i < N + 1; i++) {
			stair[i] = 0;
		} int i = 0; int i = 0; i 0 i < N + 1 i N + 1 N 1 i++ i++ i {
			stair[i] = 0;
		} {
			stair[i] = 0;
		} stair[i] = 0 stair[i] stair i 0 for(int i = 1; i < M + 1; i++) {
			int tmp2 = sc.nextInt();
			if(tmp + 1 == tmp2) {
				impossible = true;
				break;
			} else {
				stair[tmp2] = 1;
				tmp = tmp2;
			}
		} int i = 1; int i = 1; i 1 i < M + 1 i M + 1 M 1 i++ i++ i {
			int tmp2 = sc.nextInt();
			if(tmp + 1 == tmp2) {
				impossible = true;
				break;
			} else {
				stair[tmp2] = 1;
				tmp = tmp2;
			}
		} {
			int tmp2 = sc.nextInt();
			if(tmp + 1 == tmp2) {
				impossible = true;
				break;
			} else {
				stair[tmp2] = 1;
				tmp = tmp2;
			}
		} int tmp2 = sc.nextInt(); tmp2 sc.nextInt() sc.nextInt sc if(tmp + 1 == tmp2) {
				impossible = true;
				break;
			} else {
				stair[tmp2] = 1;
				tmp = tmp2;
			} tmp + 1 == tmp2 tmp + 1 tmp 1 tmp2 {
				impossible = true;
				break;
			} impossible = true impossible true break; {
				stair[tmp2] = 1;
				tmp = tmp2;
			} stair[tmp2] = 1 stair[tmp2] stair tmp2 1 tmp = tmp2 tmp tmp2 if(!impossible) {
			for(int i = 0; i < N + 1; i++) {
				count[i] = 0;
			}
			count[N] = 1;
			for(int i = N; i > 0; i--) {
				if(i > 1) {
					if(stair[i - 1] == 0) {
						count[i - 1] += count[i] % 1000000007;
					}
					if(stair[i - 2] == 0) {
						count[i - 2] += count[i] % 1000000007;
					}
				} else if(i == 1) {
					count[0] += count[i] % 1000000007;
				}
			}
			System.out.println(count[0] % 1000000007);
		} else {
			System.out.println(0);
		} !impossible impossible {
			for(int i = 0; i < N + 1; i++) {
				count[i] = 0;
			}
			count[N] = 1;
			for(int i = N; i > 0; i--) {
				if(i > 1) {
					if(stair[i - 1] == 0) {
						count[i - 1] += count[i] % 1000000007;
					}
					if(stair[i - 2] == 0) {
						count[i - 2] += count[i] % 1000000007;
					}
				} else if(i == 1) {
					count[0] += count[i] % 1000000007;
				}
			}
			System.out.println(count[0] % 1000000007);
		} for(int i = 0; i < N + 1; i++) {
				count[i] = 0;
			} int i = 0; int i = 0; i 0 i < N + 1 i N + 1 N 1 i++ i++ i {
				count[i] = 0;
			} {
				count[i] = 0;
			} count[i] = 0 count[i] count i 0 count[N] = 1 count[N] count N 1 for(int i = N; i > 0; i--) {
				if(i > 1) {
					if(stair[i - 1] == 0) {
						count[i - 1] += count[i] % 1000000007;
					}
					if(stair[i - 2] == 0) {
						count[i - 2] += count[i] % 1000000007;
					}
				} else if(i == 1) {
					count[0] += count[i] % 1000000007;
				}
			} int i = N; int i = N; i N i > 0 i 0 i-- i-- i {
				if(i > 1) {
					if(stair[i - 1] == 0) {
						count[i - 1] += count[i] % 1000000007;
					}
					if(stair[i - 2] == 0) {
						count[i - 2] += count[i] % 1000000007;
					}
				} else if(i == 1) {
					count[0] += count[i] % 1000000007;
				}
			} {
				if(i > 1) {
					if(stair[i - 1] == 0) {
						count[i - 1] += count[i] % 1000000007;
					}
					if(stair[i - 2] == 0) {
						count[i - 2] += count[i] % 1000000007;
					}
				} else if(i == 1) {
					count[0] += count[i] % 1000000007;
				}
			} if(i > 1) {
					if(stair[i - 1] == 0) {
						count[i - 1] += count[i] % 1000000007;
					}
					if(stair[i - 2] == 0) {
						count[i - 2] += count[i] % 1000000007;
					}
				} else if(i == 1) {
					count[0] += count[i] % 1000000007;
				} i > 1 i 1 {
					if(stair[i - 1] == 0) {
						count[i - 1] += count[i] % 1000000007;
					}
					if(stair[i - 2] == 0) {
						count[i - 2] += count[i] % 1000000007;
					}
				} if(stair[i - 1] == 0) {
						count[i - 1] += count[i] % 1000000007;
					} stair[i - 1] == 0 stair[i - 1] stair i - 1 i 1 0 {
						count[i - 1] += count[i] % 1000000007;
					} count[i - 1] += count[i] % 1000000007 count[i - 1] count i - 1 i 1 count[i] % 1000000007 count[i] count i 1000000007 if(stair[i - 2] == 0) {
						count[i - 2] += count[i] % 1000000007;
					} stair[i - 2] == 0 stair[i - 2] stair i - 2 i 2 0 {
						count[i - 2] += count[i] % 1000000007;
					} count[i - 2] += count[i] % 1000000007 count[i - 2] count i - 2 i 2 count[i] % 1000000007 count[i] count i 1000000007 if(i == 1) {
					count[0] += count[i] % 1000000007;
				} i == 1 i 1 {
					count[0] += count[i] % 1000000007;
				} count[0] += count[i] % 1000000007 count[0] count 0 count[i] % 1000000007 count[i] count i 1000000007 System.out.println(count[0] % 1000000007) System.out.println System.out System System.out count[0] % 1000000007 count[0] count 0 1000000007 {
			System.out.println(0);
		} System.out.println(0) System.out.println System.out System System.out 0 String[] args args public class Main {

	public static int N;
	public static int[] stair;
	public static long[] count;

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		N = sc.nextInt();
		int M = sc.nextInt();
		List<Integer> broken = new ArrayList<>();
		boolean impossible = false;
		int tmp = -1;
		stair = new int[N + 1];
		count = new long[N + 1];
		for(int i = 0; i < N + 1; i++) {
			stair[i] = 0;
		}
		for(int i = 1; i < M + 1; i++) {
			int tmp2 = sc.nextInt();
			if(tmp + 1 == tmp2) {
				impossible = true;
				break;
			} else {
				stair[tmp2] = 1;
				tmp = tmp2;
			}
		}
		if(!impossible) {
			for(int i = 0; i < N + 1; i++) {
				count[i] = 0;
			}
			count[N] = 1;
			for(int i = N; i > 0; i--) {
				if(i > 1) {
					if(stair[i - 1] == 0) {
						count[i - 1] += count[i] % 1000000007;
					}
					if(stair[i - 2] == 0) {
						count[i - 2] += count[i] % 1000000007;
					}
				} else if(i == 1) {
					count[0] += count[i] % 1000000007;
				}
			}
			System.out.println(count[0] % 1000000007);
		} else {
			System.out.println(0);
		}
	}
} public class Main {

	public static int N;
	public static int[] stair;
	public static long[] count;

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		N = sc.nextInt();
		int M = sc.nextInt();
		List<Integer> broken = new ArrayList<>();
		boolean impossible = false;
		int tmp = -1;
		stair = new int[N + 1];
		count = new long[N + 1];
		for(int i = 0; i < N + 1; i++) {
			stair[i] = 0;
		}
		for(int i = 1; i < M + 1; i++) {
			int tmp2 = sc.nextInt();
			if(tmp + 1 == tmp2) {
				impossible = true;
				break;
			} else {
				stair[tmp2] = 1;
				tmp = tmp2;
			}
		}
		if(!impossible) {
			for(int i = 0; i < N + 1; i++) {
				count[i] = 0;
			}
			count[N] = 1;
			for(int i = N; i > 0; i--) {
				if(i > 1) {
					if(stair[i - 1] == 0) {
						count[i - 1] += count[i] % 1000000007;
					}
					if(stair[i - 2] == 0) {
						count[i - 2] += count[i] % 1000000007;
					}
				} else if(i == 1) {
					count[0] += count[i] % 1000000007;
				}
			}
			System.out.println(count[0] % 1000000007);
		} else {
			System.out.println(0);
		}
	}
} Main

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

	public static int N;
	public static int[] stair;
	public static long[] count;

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		N = sc.nextInt();
		int M = sc.nextInt();
		List<Integer> broken = new ArrayList<>();
		boolean impossible = false;
		int tmp = -1;
		stair = new int[N + 1];
		count = new long[N + 1];
		for(int i = 0; i < N + 1; i++) {
			stair[i] = 0;
		}
		for(int i = 1; i < M + 1; i++) {
			int tmp2 = sc.nextInt();
			if(tmp + 1 == tmp2) {
				impossible = true;
				break;
			} else {
				stair[tmp2] = 1;
				tmp = tmp2;
			}
		}
		if(!impossible) {
			for(int i = 0; i < N + 1; i++) {
				count[i] = 0;
			}
			count[N] = 1;
			for(int i = N; i > 0; i--) {
				if(i > 1) {
					if(stair[i - 1] == 0) {
						count[i - 1] += count[i] % 1000000007;
					}
					if(stair[i - 2] == 0) {
						count[i - 2] += count[i] % 1000000007;
					}
				} else if(i == 1) {
					count[0] += count[i] % 1000000007;
				}
			}
			System.out.println(count[0] % 1000000007);
		} else {
			System.out.println(0);
		}
	}
}
