#include <bits/stdc++.h>
using namespace std;
int n;
long long B[4005];
long long A[4005];
int main() {
  B[0] = B[1] = 1;
  A[0] = 1;
  for (int i = (2), i_end_ = (4005 - 1); i <= i_end_; i++) {
    A[i - 1] = B[i - 1];
    for (int j = (i - 2), j_end_ = (0); j >= j_end_; j--)
      A[j] = (A[j] + A[j + 1]) % 1000000007;
    B[i] = A[0];
  }
  scanf("%d", &n);
  printf("%lld\n", (B[n + 1] - B[n] % 1000000007 + 1000000007) % 1000000007);
  return 0;
}
