#include <bits/stdc++.h>
#pragma GCC optimize("O3")
const double PI = acos(-1);
using namespace std;
const int mod = 1e9 + 7;
int pow_mod(int x, int p) {
  if (!p) return 1;
  int y = 1;
  for (; p > 1; p >>= 1) {
    if (p & 1) y = (((x)*1LL * (y)) % mod);
    x = (((x)*1LL * (x)) % mod);
  }
  return (((x)*1LL * (y)) % mod);
}
const int MAX = 1500;
int dp[500][MAX];
int f[MAX], r[MAX], aux;
int main() {
  int k;
  scanf("%d", &k);
  dp[1][0] = dp[1][1] = 1;
  f[0] = r[0] = 1;
  for (int i = 0; i < (MAX - 1); i++) {
    f[i + 1] = (((f[i]) * 1LL * (i + 1)) % mod);
    r[i + 1] = pow_mod(f[i + 1], mod - 2);
  }
  int lim = k + 1, x, y;
  for (int n = (2); n <= (k); n++) {
    int cur_lim = lim, n_lim = lim;
    if (n - 1 < 8) cur_lim = (1 << n) >> 1, n_lim = (1 << n);
    for (int a = (0); a <= (cur_lim); a++)
      for (int b = (0); b <= (cur_lim); b++) {
        if (a + b > n_lim) break;
        int p = (((dp[n - 1][a]) * 1LL * (dp[n - 1][b])) % mod);
        if ((a + b + 1) < n_lim)
          dp[n][a + b + 1] =
              (aux = dp[n][a + b + 1] + p, aux -= (aux >= mod) ? mod : 0);
        x = (a << 1) + (b << 1) + 1;
        dp[n][a + b] = (aux = dp[n][a + b] + (((x)*1LL * (p)) % mod),
                        aux -= (aux >= mod) ? mod : 0);
        if (a + b > 0)
          dp[n][a + b - 1] =
              (aux = dp[n][a + b - 1] +
                     (((p)*1LL *
                       ((((2) * 1LL *
                          (((a + b < 2)
                                ? 0
                                : (((f[a + b]) * 1LL *
                                    ((((r[2]) * 1LL * (r[a + b - 2])) % mod))) %
                                   mod)))) %
                         mod))) %
                      mod),
               aux -= (aux >= mod) ? mod : 0);
      }
  }
  cout << dp[k][1] << endl;
  return 0;
}
