
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.*;

public class Main {
    public static void main(String[] args) {
        final Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        final int n = in.nextInt();
        final int m = in.nextInt();
        final Set<Integer> broken = new HashSet<>();
        for (int i = 0; i < m; i++) {
            broken.add(in.nextInt());
        }

        int[] dp = new int[n + 1];

        dp[0] = 1;
        for (int i = 1; i <= n; i++) {
            if (broken.contains(i)) {
                continue;
            }
            int count = 0;
            if (!broken.contains(i - 1)) {
                count += dp[i - 1];
            }
            if (i - 2 >= 0 && !broken.contains(i - 2)) {
                count += dp[i - 2];
            }
            count %= 1_000_000_007;
            dp[i] = count;
        }
        System.out.println(dp[n]);
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        final Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        final int n = in.nextInt();
        final int m = in.nextInt();
        final Set<Integer> broken = new HashSet<>();
        for (int i = 0; i < m; i++) {
            broken.add(in.nextInt());
        }

        int[] dp = new int[n + 1];

        dp[0] = 1;
        for (int i = 1; i <= n; i++) {
            if (broken.contains(i)) {
                continue;
            }
            int count = 0;
            if (!broken.contains(i - 1)) {
                count += dp[i - 1];
            }
            if (i - 2 >= 0 && !broken.contains(i - 2)) {
                count += dp[i - 2];
            }
            count %= 1_000_000_007;
            dp[i] = count;
        }
        System.out.println(dp[n]);
    }
} Main public static void main(String[] args) {
        final Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        final int n = in.nextInt();
        final int m = in.nextInt();
        final Set<Integer> broken = new HashSet<>();
        for (int i = 0; i < m; i++) {
            broken.add(in.nextInt());
        }

        int[] dp = new int[n + 1];

        dp[0] = 1;
        for (int i = 1; i <= n; i++) {
            if (broken.contains(i)) {
                continue;
            }
            int count = 0;
            if (!broken.contains(i - 1)) {
                count += dp[i - 1];
            }
            if (i - 2 >= 0 && !broken.contains(i - 2)) {
                count += dp[i - 2];
            }
            count %= 1_000_000_007;
            dp[i] = count;
        }
        System.out.println(dp[n]);
    } main {
        final Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        final int n = in.nextInt();
        final int m = in.nextInt();
        final Set<Integer> broken = new HashSet<>();
        for (int i = 0; i < m; i++) {
            broken.add(in.nextInt());
        }

        int[] dp = new int[n + 1];

        dp[0] = 1;
        for (int i = 1; i <= n; i++) {
            if (broken.contains(i)) {
                continue;
            }
            int count = 0;
            if (!broken.contains(i - 1)) {
                count += dp[i - 1];
            }
            if (i - 2 >= 0 && !broken.contains(i - 2)) {
                count += dp[i - 2];
            }
            count %= 1_000_000_007;
            dp[i] = count;
        }
        System.out.println(dp[n]);
    } final Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in))); in new Scanner(new BufferedReader(new InputStreamReader(System.in))) final int n = in.nextInt(); n in.nextInt() in.nextInt in final int m = in.nextInt(); m in.nextInt() in.nextInt in final Set<Integer> broken = new HashSet<>(); broken new HashSet<>() for (int i = 0; i < m; i++) {
            broken.add(in.nextInt());
        } int i = 0; int i = 0; i 0 i < m i m i++ i++ i {
            broken.add(in.nextInt());
        } {
            broken.add(in.nextInt());
        } broken.add(in.nextInt()) broken.add broken in.nextInt() in.nextInt in int[] dp = new int[n + 1]; dp new int[n + 1] n + 1 n 1 dp[0] = 1 dp[0] dp 0 1 for (int i = 1; i <= n; i++) {
            if (broken.contains(i)) {
                continue;
            }
            int count = 0;
            if (!broken.contains(i - 1)) {
                count += dp[i - 1];
            }
            if (i - 2 >= 0 && !broken.contains(i - 2)) {
                count += dp[i - 2];
            }
            count %= 1_000_000_007;
            dp[i] = count;
        } int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
            if (broken.contains(i)) {
                continue;
            }
            int count = 0;
            if (!broken.contains(i - 1)) {
                count += dp[i - 1];
            }
            if (i - 2 >= 0 && !broken.contains(i - 2)) {
                count += dp[i - 2];
            }
            count %= 1_000_000_007;
            dp[i] = count;
        } {
            if (broken.contains(i)) {
                continue;
            }
            int count = 0;
            if (!broken.contains(i - 1)) {
                count += dp[i - 1];
            }
            if (i - 2 >= 0 && !broken.contains(i - 2)) {
                count += dp[i - 2];
            }
            count %= 1_000_000_007;
            dp[i] = count;
        } if (broken.contains(i)) {
                continue;
            } broken.contains(i) broken.contains broken i {
                continue;
            } continue; int count = 0; count 0 if (!broken.contains(i - 1)) {
                count += dp[i - 1];
            } !broken.contains(i - 1) broken.contains(i - 1) broken.contains broken i - 1 i 1 {
                count += dp[i - 1];
            } count += dp[i - 1] count dp[i - 1] dp i - 1 i 1 if (i - 2 >= 0 && !broken.contains(i - 2)) {
                count += dp[i - 2];
            } i - 2 >= 0 && !broken.contains(i - 2) i - 2 >= 0 i - 2 i 2 0 !broken.contains(i - 2) broken.contains(i - 2) broken.contains broken i - 2 i 2 {
                count += dp[i - 2];
            } count += dp[i - 2] count dp[i - 2] dp i - 2 i 2 count %= 1_000_000_007 count 1_000_000_007 dp[i] = count dp[i] dp i count System.out.println(dp[n]) System.out.println System.out System System.out dp[n] dp n String[] args args public class Main {
    public static void main(String[] args) {
        final Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        final int n = in.nextInt();
        final int m = in.nextInt();
        final Set<Integer> broken = new HashSet<>();
        for (int i = 0; i < m; i++) {
            broken.add(in.nextInt());
        }

        int[] dp = new int[n + 1];

        dp[0] = 1;
        for (int i = 1; i <= n; i++) {
            if (broken.contains(i)) {
                continue;
            }
            int count = 0;
            if (!broken.contains(i - 1)) {
                count += dp[i - 1];
            }
            if (i - 2 >= 0 && !broken.contains(i - 2)) {
                count += dp[i - 2];
            }
            count %= 1_000_000_007;
            dp[i] = count;
        }
        System.out.println(dp[n]);
    }
} public class Main {
    public static void main(String[] args) {
        final Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        final int n = in.nextInt();
        final int m = in.nextInt();
        final Set<Integer> broken = new HashSet<>();
        for (int i = 0; i < m; i++) {
            broken.add(in.nextInt());
        }

        int[] dp = new int[n + 1];

        dp[0] = 1;
        for (int i = 1; i <= n; i++) {
            if (broken.contains(i)) {
                continue;
            }
            int count = 0;
            if (!broken.contains(i - 1)) {
                count += dp[i - 1];
            }
            if (i - 2 >= 0 && !broken.contains(i - 2)) {
                count += dp[i - 2];
            }
            count %= 1_000_000_007;
            dp[i] = count;
        }
        System.out.println(dp[n]);
    }
} Main

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.*;

public class Main {
    public static void main(String[] args) {
        final Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        final int n = in.nextInt();
        final int m = in.nextInt();
        final Set<Integer> broken = new HashSet<>();
        for (int i = 0; i < m; i++) {
            broken.add(in.nextInt());
        }

        int[] dp = new int[n + 1];

        dp[0] = 1;
        for (int i = 1; i <= n; i++) {
            if (broken.contains(i)) {
                continue;
            }
            int count = 0;
            if (!broken.contains(i - 1)) {
                count += dp[i - 1];
            }
            if (i - 2 >= 0 && !broken.contains(i - 2)) {
                count += dp[i - 2];
            }
            count %= 1_000_000_007;
            dp[i] = count;
        }
        System.out.println(dp[n]);
    }
}
