
import java.util.Scanner

/**
 * Created by sonetsuyoshi on 2015/12/16.
 */
object Main extends App {
  val MOD = 1000000007

  val sc = new Scanner(System.in)

  val N = sc.nextInt
  val M = sc.nextInt

  val dp = Array.ofDim[Long](2, N + 1, N + 1)
  dp(0)(1)(1) = 1
  for(i <- 0 until M) {
    var from = i % 2
    var to = 1 - from

    dp(to) = Array.ofDim[Long](N + 1, N  + 1)

    for(j <- 1 to N) {
      for(k <- 1 to N) {
        val d = dp(from)(j)(k)
        if(d != 0) {
          if(N - j > 0) {
            dp(to)(j + 1)(k) += d * (N - j)
            dp(to)(j + 1)(k) %= MOD
          }
          if(j - k > 0) {
            dp(to)(j)(k) += d * (j - k)
            dp(to)(j)(k) %= MOD
          }
          dp(to)(j)(j) += d * k
          dp(to)(j)(j) %= MOD
        }
      }
    }
  }

  println(dp(M % 2)(N)(N))
}