import java.math.BigInteger; import java.util.Arrays; import java.util.Scanner; class Main { public static void main(String[] args) { long t = System.currentTimeMillis(); new Main().run(); // new Thread(null, new Main(), "", // Runtime.getRuntime().maxMemory()).start(); System.err.println(System.currentTimeMillis() - t); } long MODULO = 1_000_000_000 + 7; @SuppressWarnings("unchecked") public void run() { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); long[][] f = new long[N + 1][N + 1]; // A(n-1)!=Nのとき for (int i = 1; i <= N; ++i) { f[N][i] = 1; } for (int pre = 1; pre <= N; ++pre) { for (int ne = 1; ne <= N; ++ne) { if (pre < ne + 1) { f[1][ne] += f[N][pre]; f[1][ne] %= MODULO; } } } long[][] s = new long[N + 1][N + 1]; for (int i = 1; i <= N; ++i) { s[1][i] = (f[1][i] + s[1][i - 1]) % MODULO; } for (int num = 2; num <= N - 1; ++num) { for (int ne = 1; ne <= N; ++ne) {// pre-num+1pre s[num][v] = (s[num][v - 1] + f[num][v]) % MODULO; } } for (int v = 1; v <= N; ++v) { ans = (ans - f[N - 2][v] + MODULO) % MODULO; } System.out.println(ans); } static void tr(Object... objects) { System.out.println(Arrays.deepToString(objects)); } }