import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static final int MOD = 1_000_000_007;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();
        int M = sc.nextInt();
        int[] a = new int[M];
        for (int i = 0; i < M; i++) {
            a[i] = sc.nextInt();
        }

        System.out.println(solveDP(N, M, a));
    }

    public static int solve(int N, int M, int[] a) {
        if (N == 1) return 1;

        int[] nlist = new int[N + 1];
        int aidx = 0;

        nlist[0] = 1;
        if (M != 0 && a[0] == 1) {
            nlist[1] = 0;
            aidx = 1;
        } else {
            nlist[1] = 1;
        }

        for (int i = 2; i <= N; i++) {
            if (aidx < M && a[aidx] == i) {
                nlist[i] = 0;
                aidx++;
            } else {
                nlist[i] = (nlist[i - 1] + nlist[i - 2]) % MOD;
            }
        }

        return nlist[N];
    }

    /**
     * 解説に従い，よりDPっぽく解く
     * @param N
     * @param M
     * @param a
     * @return
     */
    public static int solveDP(int N, int M, int[] a) {
        boolean[] valid = new boolean[N+1];
        int[] dp = new int[N+1];

        Arrays.fill(valid, true);
        for (int i=0; i<M; i++) {
            valid[a[i]] = false;
        }
        dp[0] = 1;
        for (int cur=0; cur<N; cur++) {
            for (int next=cur+1; next<=Math.min(N, cur+2); next++) {
                if (valid[next]) {
                    dp[next] += dp[cur];
                    dp[next] %= MOD;
                }
            }
        }

        return dp[N];
    }
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {
    public static final int MOD = 1_000_000_007;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();
        int M = sc.nextInt();
        int[] a = new int[M];
        for (int i = 0; i < M; i++) {
            a[i] = sc.nextInt();
        }

        System.out.println(solveDP(N, M, a));
    }

    public static int solve(int N, int M, int[] a) {
        if (N == 1) return 1;

        int[] nlist = new int[N + 1];
        int aidx = 0;

        nlist[0] = 1;
        if (M != 0 && a[0] == 1) {
            nlist[1] = 0;
            aidx = 1;
        } else {
            nlist[1] = 1;
        }

        for (int i = 2; i <= N; i++) {
            if (aidx < M && a[aidx] == i) {
                nlist[i] = 0;
                aidx++;
            } else {
                nlist[i] = (nlist[i - 1] + nlist[i - 2]) % MOD;
            }
        }

        return nlist[N];
    }

    /**
     * 解説に従い，よりDPっぽく解く
     * @param N
     * @param M
     * @param a
     * @return
     */
    public static int solveDP(int N, int M, int[] a) {
        boolean[] valid = new boolean[N+1];
        int[] dp = new int[N+1];

        Arrays.fill(valid, true);
        for (int i=0; i<M; i++) {
            valid[a[i]] = false;
        }
        dp[0] = 1;
        for (int cur=0; cur<N; cur++) {
            for (int next=cur+1; next<=Math.min(N, cur+2); next++) {
                if (valid[next]) {
                    dp[next] += dp[cur];
                    dp[next] %= MOD;
                }
            }
        }

        return dp[N];
    }
} Main public static final int MOD = 1_000_000_007; MOD 1_000_000_007 public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();
        int M = sc.nextInt();
        int[] a = new int[M];
        for (int i = 0; i < M; i++) {
            a[i] = sc.nextInt();
        }

        System.out.println(solveDP(N, M, a));
    } main {
        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();
        int M = sc.nextInt();
        int[] a = new int[M];
        for (int i = 0; i < M; i++) {
            a[i] = sc.nextInt();
        }

        System.out.println(solveDP(N, M, a));
    } 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 int[] a = new int[M]; a new int[M] M for (int i = 0; i < M; i++) {
            a[i] = sc.nextInt();
        } int i = 0; int i = 0; i 0 i < M i M i++ i++ i {
            a[i] = sc.nextInt();
        } {
            a[i] = sc.nextInt();
        } a[i] = sc.nextInt() a[i] a i sc.nextInt() sc.nextInt sc System.out.println(solveDP(N, M, a)) System.out.println System.out System System.out solveDP(N, M, a) solveDP N M a String[] args args public static int solve(int N, int M, int[] a) {
        if (N == 1) return 1;

        int[] nlist = new int[N + 1];
        int aidx = 0;

        nlist[0] = 1;
        if (M != 0 && a[0] == 1) {
            nlist[1] = 0;
            aidx = 1;
        } else {
            nlist[1] = 1;
        }

        for (int i = 2; i <= N; i++) {
            if (aidx < M && a[aidx] == i) {
                nlist[i] = 0;
                aidx++;
            } else {
                nlist[i] = (nlist[i - 1] + nlist[i - 2]) % MOD;
            }
        }

        return nlist[N];
    } solve {
        if (N == 1) return 1;

        int[] nlist = new int[N + 1];
        int aidx = 0;

        nlist[0] = 1;
        if (M != 0 && a[0] == 1) {
            nlist[1] = 0;
            aidx = 1;
        } else {
            nlist[1] = 1;
        }

        for (int i = 2; i <= N; i++) {
            if (aidx < M && a[aidx] == i) {
                nlist[i] = 0;
                aidx++;
            } else {
                nlist[i] = (nlist[i - 1] + nlist[i - 2]) % MOD;
            }
        }

        return nlist[N];
    } if (N == 1) return 1; N == 1 N 1 return 1; 1 int[] nlist = new int[N + 1]; nlist new int[N + 1] N + 1 N 1 int aidx = 0; aidx 0 nlist[0] = 1 nlist[0] nlist 0 1 if (M != 0 && a[0] == 1) {
            nlist[1] = 0;
            aidx = 1;
        } else {
            nlist[1] = 1;
        } M != 0 && a[0] == 1 M != 0 M 0 a[0] == 1 a[0] a 0 1 {
            nlist[1] = 0;
            aidx = 1;
        } nlist[1] = 0 nlist[1] nlist 1 0 aidx = 1 aidx 1 {
            nlist[1] = 1;
        } nlist[1] = 1 nlist[1] nlist 1 1 for (int i = 2; i <= N; i++) {
            if (aidx < M && a[aidx] == i) {
                nlist[i] = 0;
                aidx++;
            } else {
                nlist[i] = (nlist[i - 1] + nlist[i - 2]) % MOD;
            }
        } int i = 2; int i = 2; i 2 i <= N i N i++ i++ i {
            if (aidx < M && a[aidx] == i) {
                nlist[i] = 0;
                aidx++;
            } else {
                nlist[i] = (nlist[i - 1] + nlist[i - 2]) % MOD;
            }
        } {
            if (aidx < M && a[aidx] == i) {
                nlist[i] = 0;
                aidx++;
            } else {
                nlist[i] = (nlist[i - 1] + nlist[i - 2]) % MOD;
            }
        } if (aidx < M && a[aidx] == i) {
                nlist[i] = 0;
                aidx++;
            } else {
                nlist[i] = (nlist[i - 1] + nlist[i - 2]) % MOD;
            } aidx < M && a[aidx] == i aidx < M aidx M a[aidx] == i a[aidx] a aidx i {
                nlist[i] = 0;
                aidx++;
            } nlist[i] = 0 nlist[i] nlist i 0 aidx++ aidx {
                nlist[i] = (nlist[i - 1] + nlist[i - 2]) % MOD;
            } nlist[i] = (nlist[i - 1] + nlist[i - 2]) % MOD nlist[i] nlist i (nlist[i - 1] + nlist[i - 2]) % MOD (nlist[i - 1] + nlist[i - 2]) nlist[i - 1] nlist i - 1 i 1 nlist[i - 2] nlist i - 2 i 2 MOD return nlist[N]; nlist[N] nlist N int N N int M M int[] a a /**
     * 解説に従い，よりDPっぽく解く
     * @param N
     * @param M
     * @param a
     * @return
     */
    public static int solveDP(int N, int M, int[] a) {
        boolean[] valid = new boolean[N+1];
        int[] dp = new int[N+1];

        Arrays.fill(valid, true);
        for (int i=0; i<M; i++) {
            valid[a[i]] = false;
        }
        dp[0] = 1;
        for (int cur=0; cur<N; cur++) {
            for (int next=cur+1; next<=Math.min(N, cur+2); next++) {
                if (valid[next]) {
                    dp[next] += dp[cur];
                    dp[next] %= MOD;
                }
            }
        }

        return dp[N];
    } solveDP {
        boolean[] valid = new boolean[N+1];
        int[] dp = new int[N+1];

        Arrays.fill(valid, true);
        for (int i=0; i<M; i++) {
            valid[a[i]] = false;
        }
        dp[0] = 1;
        for (int cur=0; cur<N; cur++) {
            for (int next=cur+1; next<=Math.min(N, cur+2); next++) {
                if (valid[next]) {
                    dp[next] += dp[cur];
                    dp[next] %= MOD;
                }
            }
        }

        return dp[N];
    } boolean[] valid = new boolean[N+1]; valid new boolean[N+1] N+1 N 1 int[] dp = new int[N+1]; dp new int[N+1] N+1 N 1 Arrays.fill(valid, true) Arrays.fill Arrays valid true for (int i=0; i<M; i++) {
            valid[a[i]] = false;
        } int i=0; int i=0; i 0 i<M i M i++ i++ i {
            valid[a[i]] = false;
        } {
            valid[a[i]] = false;
        } valid[a[i]] = false valid[a[i]] valid a[i] a i false dp[0] = 1 dp[0] dp 0 1 for (int cur=0; cur<N; cur++) {
            for (int next=cur+1; next<=Math.min(N, cur+2); next++) {
                if (valid[next]) {
                    dp[next] += dp[cur];
                    dp[next] %= MOD;
                }
            }
        } int cur=0; int cur=0; cur 0 cur<N cur N cur++ cur++ cur {
            for (int next=cur+1; next<=Math.min(N, cur+2); next++) {
                if (valid[next]) {
                    dp[next] += dp[cur];
                    dp[next] %= MOD;
                }
            }
        } {
            for (int next=cur+1; next<=Math.min(N, cur+2); next++) {
                if (valid[next]) {
                    dp[next] += dp[cur];
                    dp[next] %= MOD;
                }
            }
        } for (int next=cur+1; next<=Math.min(N, cur+2); next++) {
                if (valid[next]) {
                    dp[next] += dp[cur];
                    dp[next] %= MOD;
                }
            } int next=cur+1; int next=cur+1; next cur+1 cur 1 next<=Math.min(N, cur+2) next Math.min(N, cur+2) Math.min Math N cur+2 cur 2 next++ next++ next {
                if (valid[next]) {
                    dp[next] += dp[cur];
                    dp[next] %= MOD;
                }
            } {
                if (valid[next]) {
                    dp[next] += dp[cur];
                    dp[next] %= MOD;
                }
            } if (valid[next]) {
                    dp[next] += dp[cur];
                    dp[next] %= MOD;
                } valid[next] valid next {
                    dp[next] += dp[cur];
                    dp[next] %= MOD;
                } dp[next] += dp[cur] dp[next] dp next dp[cur] dp cur dp[next] %= MOD dp[next] dp next MOD return dp[N]; dp[N] dp N int N N int M M int[] a a public class Main {
    public static final int MOD = 1_000_000_007;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();
        int M = sc.nextInt();
        int[] a = new int[M];
        for (int i = 0; i < M; i++) {
            a[i] = sc.nextInt();
        }

        System.out.println(solveDP(N, M, a));
    }

    public static int solve(int N, int M, int[] a) {
        if (N == 1) return 1;

        int[] nlist = new int[N + 1];
        int aidx = 0;

        nlist[0] = 1;
        if (M != 0 && a[0] == 1) {
            nlist[1] = 0;
            aidx = 1;
        } else {
            nlist[1] = 1;
        }

        for (int i = 2; i <= N; i++) {
            if (aidx < M && a[aidx] == i) {
                nlist[i] = 0;
                aidx++;
            } else {
                nlist[i] = (nlist[i - 1] + nlist[i - 2]) % MOD;
            }
        }

        return nlist[N];
    }

    /**
     * 解説に従い，よりDPっぽく解く
     * @param N
     * @param M
     * @param a
     * @return
     */
    public static int solveDP(int N, int M, int[] a) {
        boolean[] valid = new boolean[N+1];
        int[] dp = new int[N+1];

        Arrays.fill(valid, true);
        for (int i=0; i<M; i++) {
            valid[a[i]] = false;
        }
        dp[0] = 1;
        for (int cur=0; cur<N; cur++) {
            for (int next=cur+1; next<=Math.min(N, cur+2); next++) {
                if (valid[next]) {
                    dp[next] += dp[cur];
                    dp[next] %= MOD;
                }
            }
        }

        return dp[N];
    }
} public class Main {
    public static final int MOD = 1_000_000_007;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();
        int M = sc.nextInt();
        int[] a = new int[M];
        for (int i = 0; i < M; i++) {
            a[i] = sc.nextInt();
        }

        System.out.println(solveDP(N, M, a));
    }

    public static int solve(int N, int M, int[] a) {
        if (N == 1) return 1;

        int[] nlist = new int[N + 1];
        int aidx = 0;

        nlist[0] = 1;
        if (M != 0 && a[0] == 1) {
            nlist[1] = 0;
            aidx = 1;
        } else {
            nlist[1] = 1;
        }

        for (int i = 2; i <= N; i++) {
            if (aidx < M && a[aidx] == i) {
                nlist[i] = 0;
                aidx++;
            } else {
                nlist[i] = (nlist[i - 1] + nlist[i - 2]) % MOD;
            }
        }

        return nlist[N];
    }

    /**
     * 解説に従い，よりDPっぽく解く
     * @param N
     * @param M
     * @param a
     * @return
     */
    public static int solveDP(int N, int M, int[] a) {
        boolean[] valid = new boolean[N+1];
        int[] dp = new int[N+1];

        Arrays.fill(valid, true);
        for (int i=0; i<M; i++) {
            valid[a[i]] = false;
        }
        dp[0] = 1;
        for (int cur=0; cur<N; cur++) {
            for (int next=cur+1; next<=Math.min(N, cur+2); next++) {
                if (valid[next]) {
                    dp[next] += dp[cur];
                    dp[next] %= MOD;
                }
            }
        }

        return dp[N];
    }
} Main
import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static final int MOD = 1_000_000_007;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();
        int M = sc.nextInt();
        int[] a = new int[M];
        for (int i = 0; i < M; i++) {
            a[i] = sc.nextInt();
        }

        System.out.println(solveDP(N, M, a));
    }

    public static int solve(int N, int M, int[] a) {
        if (N == 1) return 1;

        int[] nlist = new int[N + 1];
        int aidx = 0;

        nlist[0] = 1;
        if (M != 0 && a[0] == 1) {
            nlist[1] = 0;
            aidx = 1;
        } else {
            nlist[1] = 1;
        }

        for (int i = 2; i <= N; i++) {
            if (aidx < M && a[aidx] == i) {
                nlist[i] = 0;
                aidx++;
            } else {
                nlist[i] = (nlist[i - 1] + nlist[i - 2]) % MOD;
            }
        }

        return nlist[N];
    }

    /**
     * 解説に従い，よりDPっぽく解く
     * @param N
     * @param M
     * @param a
     * @return
     */
    public static int solveDP(int N, int M, int[] a) {
        boolean[] valid = new boolean[N+1];
        int[] dp = new int[N+1];

        Arrays.fill(valid, true);
        for (int i=0; i<M; i++) {
            valid[a[i]] = false;
        }
        dp[0] = 1;
        for (int cur=0; cur<N; cur++) {
            for (int next=cur+1; next<=Math.min(N, cur+2); next++) {
                if (valid[next]) {
                    dp[next] += dp[cur];
                    dp[next] %= MOD;
                }
            }
        }

        return dp[N];
    }
}