import java.util.*;

public class Main {
	public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        List<Integer> list = new ArrayList<Integer>();
        for (int tmp = 0; tmp < m; tmp++) {
            int w = sc.nextInt();

            list.add(w);
        }

        long INF = 1000000007;
        long[] dp = new long[n + 1];

        dp[0] = 1;
        dp[1] = 1;

        for (int i = 0; i < m; i++) {
            dp[list.get(i)] = -1;
        }

        for (int j = 2; j <= n; j++) {
            if (dp[j] != -1 && dp[j - 1] != -1 && dp[j - 2] != -1) {
                dp[j] = (dp[j - 1] + dp[j - 2]) % INF;
            } else if (dp[j] != -1 && dp[j - 1] == -1) {
                dp[j] = (dp[j - 2]);
            } else if (dp[j] != -1 && dp[j - 2] == -1) {
                dp[j] = (dp[j - 1]);
            }


        }
        if (dp[n] == -1) {
            System.out.println(0);
        } else {
            System.out.println(dp[n] % INF);
        }
    }
} import java.util.*; util.* java public class Main {
	public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        List<Integer> list = new ArrayList<Integer>();
        for (int tmp = 0; tmp < m; tmp++) {
            int w = sc.nextInt();

            list.add(w);
        }

        long INF = 1000000007;
        long[] dp = new long[n + 1];

        dp[0] = 1;
        dp[1] = 1;

        for (int i = 0; i < m; i++) {
            dp[list.get(i)] = -1;
        }

        for (int j = 2; j <= n; j++) {
            if (dp[j] != -1 && dp[j - 1] != -1 && dp[j - 2] != -1) {
                dp[j] = (dp[j - 1] + dp[j - 2]) % INF;
            } else if (dp[j] != -1 && dp[j - 1] == -1) {
                dp[j] = (dp[j - 2]);
            } else if (dp[j] != -1 && dp[j - 2] == -1) {
                dp[j] = (dp[j - 1]);
            }


        }
        if (dp[n] == -1) {
            System.out.println(0);
        } else {
            System.out.println(dp[n] % INF);
        }
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        List<Integer> list = new ArrayList<Integer>();
        for (int tmp = 0; tmp < m; tmp++) {
            int w = sc.nextInt();

            list.add(w);
        }

        long INF = 1000000007;
        long[] dp = new long[n + 1];

        dp[0] = 1;
        dp[1] = 1;

        for (int i = 0; i < m; i++) {
            dp[list.get(i)] = -1;
        }

        for (int j = 2; j <= n; j++) {
            if (dp[j] != -1 && dp[j - 1] != -1 && dp[j - 2] != -1) {
                dp[j] = (dp[j - 1] + dp[j - 2]) % INF;
            } else if (dp[j] != -1 && dp[j - 1] == -1) {
                dp[j] = (dp[j - 2]);
            } else if (dp[j] != -1 && dp[j - 2] == -1) {
                dp[j] = (dp[j - 1]);
            }


        }
        if (dp[n] == -1) {
            System.out.println(0);
        } else {
            System.out.println(dp[n] % INF);
        }
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        List<Integer> list = new ArrayList<Integer>();
        for (int tmp = 0; tmp < m; tmp++) {
            int w = sc.nextInt();

            list.add(w);
        }

        long INF = 1000000007;
        long[] dp = new long[n + 1];

        dp[0] = 1;
        dp[1] = 1;

        for (int i = 0; i < m; i++) {
            dp[list.get(i)] = -1;
        }

        for (int j = 2; j <= n; j++) {
            if (dp[j] != -1 && dp[j - 1] != -1 && dp[j - 2] != -1) {
                dp[j] = (dp[j - 1] + dp[j - 2]) % INF;
            } else if (dp[j] != -1 && dp[j - 1] == -1) {
                dp[j] = (dp[j - 2]);
            } else if (dp[j] != -1 && dp[j - 2] == -1) {
                dp[j] = (dp[j - 1]);
            }


        }
        if (dp[n] == -1) {
            System.out.println(0);
        } else {
            System.out.println(dp[n] % INF);
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int m = sc.nextInt(); m sc.nextInt() sc.nextInt sc List<Integer> list = new ArrayList<Integer>(); list new ArrayList<Integer>() for (int tmp = 0; tmp < m; tmp++) {
            int w = sc.nextInt();

            list.add(w);
        } int tmp = 0; int tmp = 0; tmp 0 tmp < m tmp m tmp++ tmp++ tmp {
            int w = sc.nextInt();

            list.add(w);
        } {
            int w = sc.nextInt();

            list.add(w);
        } int w = sc.nextInt(); w sc.nextInt() sc.nextInt sc list.add(w) list.add list w long INF = 1000000007; INF 1000000007 long[] dp = new long[n + 1]; dp new long[n + 1] n + 1 n 1 dp[0] = 1 dp[0] dp 0 1 dp[1] = 1 dp[1] dp 1 1 for (int i = 0; i < m; i++) {
            dp[list.get(i)] = -1;
        } int i = 0; int i = 0; i 0 i < m i m i++ i++ i {
            dp[list.get(i)] = -1;
        } {
            dp[list.get(i)] = -1;
        } dp[list.get(i)] = -1 dp[list.get(i)] dp list.get(i) list.get list i -1 1 for (int j = 2; j <= n; j++) {
            if (dp[j] != -1 && dp[j - 1] != -1 && dp[j - 2] != -1) {
                dp[j] = (dp[j - 1] + dp[j - 2]) % INF;
            } else if (dp[j] != -1 && dp[j - 1] == -1) {
                dp[j] = (dp[j - 2]);
            } else if (dp[j] != -1 && dp[j - 2] == -1) {
                dp[j] = (dp[j - 1]);
            }


        } int j = 2; int j = 2; j 2 j <= n j n j++ j++ j {
            if (dp[j] != -1 && dp[j - 1] != -1 && dp[j - 2] != -1) {
                dp[j] = (dp[j - 1] + dp[j - 2]) % INF;
            } else if (dp[j] != -1 && dp[j - 1] == -1) {
                dp[j] = (dp[j - 2]);
            } else if (dp[j] != -1 && dp[j - 2] == -1) {
                dp[j] = (dp[j - 1]);
            }


        } {
            if (dp[j] != -1 && dp[j - 1] != -1 && dp[j - 2] != -1) {
                dp[j] = (dp[j - 1] + dp[j - 2]) % INF;
            } else if (dp[j] != -1 && dp[j - 1] == -1) {
                dp[j] = (dp[j - 2]);
            } else if (dp[j] != -1 && dp[j - 2] == -1) {
                dp[j] = (dp[j - 1]);
            }


        } if (dp[j] != -1 && dp[j - 1] != -1 && dp[j - 2] != -1) {
                dp[j] = (dp[j - 1] + dp[j - 2]) % INF;
            } else if (dp[j] != -1 && dp[j - 1] == -1) {
                dp[j] = (dp[j - 2]);
            } else if (dp[j] != -1 && dp[j - 2] == -1) {
                dp[j] = (dp[j - 1]);
            } dp[j] != -1 && dp[j - 1] != -1 && dp[j - 2] != -1 dp[j] != -1 && dp[j - 1] != -1 && dp[j - 2] != -1 dp[j] != -1 dp[j] dp j -1 1 dp[j - 1] != -1 dp[j - 1] dp j - 1 j 1 -1 1 dp[j - 2] != -1 dp[j - 2] dp j - 2 j 2 -1 1 {
                dp[j] = (dp[j - 1] + dp[j - 2]) % INF;
            } dp[j] = (dp[j - 1] + dp[j - 2]) % INF dp[j] dp j (dp[j - 1] + dp[j - 2]) % INF (dp[j - 1] + dp[j - 2]) dp[j - 1] dp j - 1 j 1 dp[j - 2] dp j - 2 j 2 INF if (dp[j] != -1 && dp[j - 1] == -1) {
                dp[j] = (dp[j - 2]);
            } else if (dp[j] != -1 && dp[j - 2] == -1) {
                dp[j] = (dp[j - 1]);
            } dp[j] != -1 && dp[j - 1] == -1 dp[j] != -1 dp[j] dp j -1 1 dp[j - 1] == -1 dp[j - 1] dp j - 1 j 1 -1 1 {
                dp[j] = (dp[j - 2]);
            } dp[j] = (dp[j - 2]) dp[j] dp j (dp[j - 2]) dp j - 2 j 2 if (dp[j] != -1 && dp[j - 2] == -1) {
                dp[j] = (dp[j - 1]);
            } dp[j] != -1 && dp[j - 2] == -1 dp[j] != -1 dp[j] dp j -1 1 dp[j - 2] == -1 dp[j - 2] dp j - 2 j 2 -1 1 {
                dp[j] = (dp[j - 1]);
            } dp[j] = (dp[j - 1]) dp[j] dp j (dp[j - 1]) dp j - 1 j 1 if (dp[n] == -1) {
            System.out.println(0);
        } else {
            System.out.println(dp[n] % INF);
        } dp[n] == -1 dp[n] dp n -1 1 {
            System.out.println(0);
        } System.out.println(0) System.out.println System.out System System.out 0 {
            System.out.println(dp[n] % INF);
        } System.out.println(dp[n] % INF) System.out.println System.out System System.out dp[n] % INF dp[n] dp n INF String[] args args public class Main {
	public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        List<Integer> list = new ArrayList<Integer>();
        for (int tmp = 0; tmp < m; tmp++) {
            int w = sc.nextInt();

            list.add(w);
        }

        long INF = 1000000007;
        long[] dp = new long[n + 1];

        dp[0] = 1;
        dp[1] = 1;

        for (int i = 0; i < m; i++) {
            dp[list.get(i)] = -1;
        }

        for (int j = 2; j <= n; j++) {
            if (dp[j] != -1 && dp[j - 1] != -1 && dp[j - 2] != -1) {
                dp[j] = (dp[j - 1] + dp[j - 2]) % INF;
            } else if (dp[j] != -1 && dp[j - 1] == -1) {
                dp[j] = (dp[j - 2]);
            } else if (dp[j] != -1 && dp[j - 2] == -1) {
                dp[j] = (dp[j - 1]);
            }


        }
        if (dp[n] == -1) {
            System.out.println(0);
        } else {
            System.out.println(dp[n] % INF);
        }
    }
} public class Main {
	public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        List<Integer> list = new ArrayList<Integer>();
        for (int tmp = 0; tmp < m; tmp++) {
            int w = sc.nextInt();

            list.add(w);
        }

        long INF = 1000000007;
        long[] dp = new long[n + 1];

        dp[0] = 1;
        dp[1] = 1;

        for (int i = 0; i < m; i++) {
            dp[list.get(i)] = -1;
        }

        for (int j = 2; j <= n; j++) {
            if (dp[j] != -1 && dp[j - 1] != -1 && dp[j - 2] != -1) {
                dp[j] = (dp[j - 1] + dp[j - 2]) % INF;
            } else if (dp[j] != -1 && dp[j - 1] == -1) {
                dp[j] = (dp[j - 2]);
            } else if (dp[j] != -1 && dp[j - 2] == -1) {
                dp[j] = (dp[j - 1]);
            }


        }
        if (dp[n] == -1) {
            System.out.println(0);
        } else {
            System.out.println(dp[n] % INF);
        }
    }
} Main
import java.util.*;

public class Main {
	public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        List<Integer> list = new ArrayList<Integer>();
        for (int tmp = 0; tmp < m; tmp++) {
            int w = sc.nextInt();

            list.add(w);
        }

        long INF = 1000000007;
        long[] dp = new long[n + 1];

        dp[0] = 1;
        dp[1] = 1;

        for (int i = 0; i < m; i++) {
            dp[list.get(i)] = -1;
        }

        for (int j = 2; j <= n; j++) {
            if (dp[j] != -1 && dp[j - 1] != -1 && dp[j - 2] != -1) {
                dp[j] = (dp[j - 1] + dp[j - 2]) % INF;
            } else if (dp[j] != -1 && dp[j - 1] == -1) {
                dp[j] = (dp[j - 2]);
            } else if (dp[j] != -1 && dp[j - 2] == -1) {
                dp[j] = (dp[j - 1]);
            }


        }
        if (dp[n] == -1) {
            System.out.println(0);
        } else {
            System.out.println(dp[n] % INF);
        }
    }
}