#include <bits/stdc++.h>
using namespace std;
const int MAX = 4000 + 10;
long long dp[MAX][MAX];
long long chose[MAX][MAX];
int main() {
  dp[0][0] = 1;
  dp[1][0] = 1;
  dp[1][1] = 2;
  int n;
  cin >> n;
  for (int i = 2; i < n; i++) {
    dp[i][0] = dp[i - 1][i - 1];
    for (int j = 1; j <= i; j++) {
      dp[i][j] = (dp[i - 1][j - 1] + dp[i][j - 1]) % (1000000000 + 7);
    }
  }
  for (int i = 0; i < n; i++) {
    chose[0][i] = chose[i][0] = 1;
  }
  for (int i = 1; i < n; i++) {
    for (int j = 1; j < n; j++) {
      chose[i][j] = (chose[i - 1][j] + chose[i][j - 1]) % (1000000000 + 7);
    }
  }
  long long ans = 0;
  for (int i = n - 1; i > 0; i--) {
    ans += (dp[i - 1][i - 1] * chose[n - i][i]) % (1000000000 + 7);
  }
  cout << (ans + 1) % (1000000000 + 7) << endl;
  return 0;
}
