output_description: Print the number of sequences of towns satisfying the condition, modulo
  1000000007 (=10^9+7).
  
  * * *
input_description: The input is given from Standard Input in the following format:
  
      
      
      N M
attempt: # dp[i][j] := i 回の移動で頂点 1 から自由に j 個行き来できて王様がその中にいる場合の数
  # O(N^2 M^2) の解を書こうと思ったけど最後に戻ってこないパターンが抜けてる
  # 面倒になって諦め
  
  exit()
  
  
  class Combination:
      def __init__(self, n_max, mod=10**9 + 7):
          # O(n_max + log(mod))
          self.mod = mod
          f = 1
          self.fac = fac = [f]
          for i in range(1, n_max + 1):
              f = f * i % mod
              fac.append(f)
          f = pow(f, mod - 2, mod)
          self.facinv = facinv = [f]
          for i in range(n_max, 0, -1):
              f = f * i % mod
              facinv.append(f)
          facinv.reverse()
  
      # "n 要素" は区別できる n 要素
      # "k グループ" はちょうど k グループ
  
      def __call__(self, n, r):  # self.C と同じ
          return self.fac[n] * self.facinv[r] % self.mod * self.facinv[n - r] % self.mod
  
      def C(self, n, r):
          if not 0 <= r <= n:
              return 0
          return self.fac[n] * self.facinv[r] % self.mod * self.facinv[n - r] % self.mod
  
      def P(self, n, r):
          if not 0 <= r <= n:
              return 0
          return self.fac[n] * self.facinv[n - r] % self.mod
  
      def H(self, n, r):
          if (n == 0 and r > 0) or r < 0:
              return 0
          return (
              self.fac[n + r - 1]
              * self.facinv[r]
              % self.mod
              * self.facinv[n - 1]
              % self.mod
          )
  
      def rising_factorial(self, n, r):  # 上昇階乗冪 n * (n+1) * ... * (n+r-1)
          return self.fac[n + r - 1] * self.facinv[n - 1] % self.mod
  
      def stirling_first(
          self, n, k
      ):  # 第 1 種スターリング数  lru_cache を使うと O(nk)  # n 要素を k 個の巡回列に分割する場合の数
          if n == k:
              return 1
          if k == 0:
              return 0
          return (
              self.stirling_first(n - 1, k - 1) + (n - 1) * self.stirling_first(n - 1, k)
          ) % self.mod
  
      def stirling_second(
          self, n, k
      ):  # 第 2 種スターリング数 O(k + log(n))  # n 要素を区別のない k グループに分割する場合の数
          if n == k:
              return 1  # n==k==0 のときのため
          return (
              self.facinv[k]
              * sum(
                  (-1) ** (k - m) * self.C(k, m) * pow(m, n, self.mod)
                  for m in range(1, k + 1)
              )
              % self.mod
          )
  
      def balls_and_boxes_3(
          self, n, k
      ):  # n 要素を区別のある k グループに分割する場合の数  O(k + log(n))
          if n < k:
              return 0
          return (
              sum(
                  (-1) ** (k - m) * self.C(k, m) * pow(m, n, self.mod)
                  for m in range(1, k + 1)
              )
              % self.mod
          )
  
      def bernoulli(self, n):  # ベルヌーイ数  lru_cache を使うと O(n**2 * log(mod))
          if n == 0:
              return 1
          if n % 2 and n >= 3:
              return 0  # 高速化
          return (
              -pow(n + 1, self.mod - 2, self.mod)
              * sum(self.C(n + 1, k) * self.bernoulli(k) % self.mod for k in range(n))
          ) % self.mod
  
      def faulhaber(self, k, n):  # べき乗和 0^k + 1^k + ... + (n-1)^k
          # bernoulli に lru_cache を使うと O(k**2 * log(mod))  bernoulli が計算済みなら O(k * log(mod))
          return (
              pow(k + 1, self.mod - 2, self.mod)
              * sum(
                  self.C(k + 1, j)
                  * self.bernoulli(j)
                  % self.mod
                  * pow(n, k - j + 1, self.mod)
                  % self.mod
                  for j in range(k + 1)
              )
              % self.mod
          )
  
      def lah(self, n, k):  # n 要素を k 個の空でない順序付き集合に分割する場合の数  O(1)
          return self.C(n - 1, k - 1) * self.fac[n] % self.mod * self.facinv[k] % self.mod
  
      def bell(
          self, n, k
      ):  # n 要素を k グループ以下に分割する場合の数  O(k**2 + k*log(mod))
          return sum(self.stirling_second(n, j) for j in range(1, k + 1)) % self.mod
  
  
  mod = 10**9 + 7
  comb = Combination(300, mod)
  balls_and_boxes_3 = [[0] * 301 for _ in range(301)]
  for n in range(301):
      for k in range(301):
          balls_and_boxes_3[n][k] = comb.balls_and_boxes_3(n, k)
  
  N, M = map(int, input().split())
  dp = [[0] * (N + 1) for _ in range(M + 1)]
  dp[0][1] = 1
  for i in range(1, M + 1):
      for j in range(1, N + 1):
          n, k = 1, 0
          dp[i][j] += dp[i - 1][j] * j % mod
          for n in range(1, i + 1):
              for k in range(1, min(j - 1, n) + 1):  # k=0 の場合も
                  dp[i][j] += (
                      dp[i - n][j - k]
                      * comb.C(N - (j - k), k)
                      % mod
                      * balls_and_boxes_3[n - 1][k]
                      % mod
                      * (j - k)
                      % mod
                  )
  
  for d in dp:
      print(d)
  
  print(dp[-1][-1])
  
problem_description: Statement
  
  There are N towns in Takahashi Kingdom. They are conveniently numbered 1
  through N.
  
  Takahashi the king is planning to go on a tour of inspection for M days. He
  will determine a sequence of towns c, and visit town c_i on the i-th day. That
  is, on the i-th day, he will travel from his current location to town c_i. If
  he is already at town c_i, he will stay at that town. His location just before
  the beginning of the tour is town 1, the capital. The tour ends at town c_M,
  without getting back to the capital.
  
  The problem is that there is no paved road in this kingdom. He decided to
  resolve this issue by paving the road himself while traveling. When he travels
  from town a to town b, there will be a newly paved one-way road from town a to
  town b.
  
  Since he cares for his people, he wants the following condition to be
  satisfied after his tour is over: "it is possible to travel from any town to
  any other town by traversing roads paved by him". How many sequences of towns
  c satisfy this condition?
samples: [{"input": "3 3", "output": "2\n    \n\nAs shown below, the condition is satisfied only when c = (2,3,1) or c =\n(3,2,1). Sequences such as c = (2,3,2), c = (2,1,3), c = (1,2,2) do not\nsatisfy the condition.\n\n![](https://atcoder.jp/img/code-\nfestival-2016-final/199a3fd8d2aed75750901a206c8b7e76.png)\n\n* * *"}, {"input": "150 300", "output": "734286322\n    \n\n* * *"}, {"input": "300 150", "output": "0"}]