package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)
var wrtr = bufio.NewWriterSize(os.Stdout, 10_000_000)
var rdr = bufio.NewScanner(os.Stdin)
func gs() string  { rdr.Scan(); return rdr.Text() }
func gi() int     { i,e := strconv.Atoi(gs()); if e != nil {panic(e)}; return i }
func gis(n int) []int  { res := make([]int,n); for i:=0;i<n;i++ { res[i] = gi() }; return res }
func gf() float64 { f,e := strconv.ParseFloat(gs(),64); if e != nil {panic(e)}; return f }
func gbs() []byte { return []byte(gs()) }
func gfs(n int) []float64  { res := make([]float64,n); for i:=0;i<n;i++ { res[i] = gf() }; return res }
func gss(n int) []string  { res := make([]string,n); for i:=0;i<n;i++ { res[i] = gs() }; return res }
func gi64() int64     { i,e := strconv.ParseInt(gs(),10,64); if e != nil {panic(e)}; return i }
func gis64(n int) []int64  { res := make([]int64,n); for i:=0;i<n;i++ { res[i] = gi64() }; return res }

func ia(m int) []int { return make([]int,m) }
func iai(m int,v int) []int { a := make([]int,m); for i:=0;i<m;i++ { a[i] = v }; return a }
func twodi(n int,m int,v int) [][]int {
	r := make([][]int,n); for i:=0;i<n;i++ { x := make([]int,m); for j:=0;j<m;j++ { x[j] = v }; r[i] = x }; return r
}
func fill2(m int) ([]int,[]int) { a,b := ia(m),ia(m); for i:=0;i<m;i++ {a[i],b[i] = gi(),gi()}; return a,b }
func fill3(m int) ([]int,[]int,[]int) { a,b,c := ia(m),ia(m),ia(m); for i:=0;i<m;i++ {a[i],b[i],c[i] = gi(),gi(),gi()}; return a,b,c }
func fill4(m int) ([]int,[]int,[]int,[]int) { a,b,c,d := ia(m),ia(m),ia(m),ia(m); for i:=0;i<m;i++ {a[i],b[i],c[i],d[i] = gi(),gi(),gi(),gi()}; return a,b,c,d }
func abs(a int) int { if a < 0 { return -a }; return a }
func rev(a []int) { i,j := 0,len(a)-1; for i < j { a[i],a[j] = a[j],a[i]; i++; j-- } }
func max(a,b int) int { if a > b { return a }; return b }
func min(a,b int) int { if a > b { return b }; return a }
func maxarr(a []int) int { ans := a[0]; for _,aa := range(a) { if aa > ans { ans = aa } }; return ans }
func minarr(a []int) int { ans := a[0]; for _,aa := range(a) { if aa < ans { ans = aa } }; return ans }
func sumarr(a []int) int { ans := 0; for _,aa := range(a) { ans += aa }; return ans }
func zeroarr(a []int) { for i:=0; i<len(a); i++ { a[i] = 0 } }
func powmod(a,e,mod int) int { res, m := 1, a; for e > 0 { if e&1 != 0 { res = res * m % mod }; m = m * m % mod; e >>= 1 }; return res }
func powint(a,e int) int { res, m := 1, a; for e > 0 { if e&1 != 0 { res = res * m }; m = m * m; e >>= 1 }; return res }
func gcd(a,b int) int { for b != 0 { t:=b; b=a%b; a=t }; return a }
func gcdExtended(a,b int) (int,int,int) { if a == 0 { return b,0,1 }; gcd,x1,y1 := gcdExtended(b%a,a); return gcd, y1-(b/a)*x1,x1 }
func modinv(a,m int) (int,bool) { g,x,_ := gcdExtended(a,m); if g != 1 { return 0,false }; return (x % m + m) % m,true  }
func vecintstring(a []int) string { astr := make([]string,len(a)); for i,a := range a { astr[i] = strconv.Itoa(a) }; return strings.Join(astr," ") }
func makefact(n int,mod int) ([]int,[]int) {
	fact,factinv := make([]int,n+1),make([]int,n+1)
	fact[0] = 1; for i:=1;i<=n;i++ { fact[i] = fact[i-1] * i % mod }
	factinv[n] = powmod(fact[n],mod-2,mod); for i:=n-1;i>=0;i-- { factinv[i] = factinv[i+1] * (i+1) % mod }
	return fact,factinv
}

func ia64(m int) []int64 { return make([]int64,m) }
func iai64(m int,v int64) []int64 { a := make([]int64,m); for i:=0;i<m;i++ { a[i] = v }; return a }
func twodi64(n int,m int,v int64) [][]int64 {
	r := make([][]int64,n); for i:=0;i<n;i++ { x := make([]int64,m); for j:=0;j<m;j++ { x[j] = v }; r[i] = x }; return r
}
func fill264(m int) ([]int64,[]int64) { a,b := ia64(m),ia64(m); for i:=0;i<m;i++ {a[i],b[i] = gi64(),gi64()}; return a,b }
func fill364(m int) ([]int64,[]int64,[]int64) { a,b,c := ia64(m),ia64(m),ia64(m); for i:=0;i<m;i++ {a[i],b[i],c[i] = gi64(),gi64(),gi64()}; return a,b,c }
func fill464(m int) ([]int64,[]int64,[]int64,[]int64) { a,b,c,d := ia64(m),ia64(m),ia64(m),ia64(m); for i:=0;i<m;i++ {a[i],b[i],c[i],d[i] = gi64(),gi64(),gi64(),gi64()}; return a,b,c,d }
func abs64(a int64) int64 { if a < 0 { return -a }; return a }
func rev64(a []int64) { i,j := 0,len(a)-1; for i < j { a[i],a[j] = a[j],a[i]; i++; j-- } }
func max64(a,b int64) int64 { if a > b { return a }; return b }
func min64(a,b int64) int64 { if a > b { return b }; return a }
func maxarr64(a []int64) int64 { ans := a[0]; for _,aa := range(a) { if aa > ans { ans = aa } }; return ans }
func minarr64(a []int64) int64 { ans := a[0]; for _,aa := range(a) { if aa < ans { ans = aa } }; return ans }
func sumarr64(a []int64) int64 { ans := int64(0); for _,aa := range(a) { ans += aa }; return ans }
func zeroarr64(a []int64) { for i:=0; i<len(a); i++ { a[i] = 0 } }
func powmod64(a,e,mod int64) int64 { res, m := int64(1), a; for e > 0 { if e&1 != 0 { res = res * m % mod }; m = m * m % mod; e >>= 1 }; return res }
func powint64(a,e int64) int64 { res, m := int64(1), a; for e > 0 { if e&1 != 0 { res = res * m }; m = m * m; e >>= 1 }; return res }
func gcd64(a,b int64) int64 { for b != 0 { t:=b; b=a%b; a=t }; return a }
func gcdExtended64(a,b int64) (int64,int64,int64) { if a == 0 { return b,0,1 }; gcd,x1,y1 := gcdExtended64(b%a,a); return gcd, y1-(b/a)*x1,x1 }
func modinv64(a,m int64) (int64,bool) { g,x,_ := gcdExtended64(a,m); if g != 1 { return 0,false }; return (x % m + m) % m,true  }
func vecint64string(a []int64) string { astr := make([]string,len(a)); for i,a := range a { astr[i] = strconv.FormatInt(a,10) }; return strings.Join(astr," ") }
func makefact64(n int,mod int64) ([]int64,[]int64) {
	fact,factinv := make([]int64,n+1),make([]int64,n+1)
	fact[0] = 1; for i:=1;i<=n;i++ { fact[i] = fact[i-1] * int64(i) % mod }
	factinv[n] = powmod64(fact[n],mod-2,mod); for i:=n-1;i>=0;i-- { factinv[i] = factinv[i+1] * int64(i+1) % mod }
	return fact,factinv
}
func main() {
	//f1, _ := os.Create("cpu.prof"); pprof.StartCPUProfile(f1); defer pprof.StopCPUProfile()
	defer wrtr.Flush()
	infn := ""; if infn == "" && len(os.Args) > 1 {	infn = os.Args[1] }
	if infn != "" {	f, e := os.Open(infn); if e != nil { panic(e) }; rdr = bufio.NewScanner(f) }
	rdr.Split(bufio.ScanWords); rdr.Buffer(make([]byte,1024),1_000_000_000)
	// PROGRAM STARTS HERE
	S := gbs()
	oc := 0; fo := -1; for i,c := range S { if c == '1' { oc++; if fo == -1 { fo = i } } }
	if oc == 0 { fmt.Println(-1); return }
	if oc == 1 { fmt.Printf("%v %v\n",fo+1,fo+2); return }

	// Flip the string around and put position 0/1 on the right and and look for the smallest two positions
	p := int64(0); for _,c := range S { p = p << 1; if c == '1' { p |= 1 } }
	// Consider p as a polynomial P(x) over GF(2)
	// We are looking to find a polynomial x^k+1 = P(x)Q(x) for some polynomial Q(x)
	// ** Q(x) represents the places in the string where we start our xor, and x^k+1 represents the two ones that are left over.
	// We want to find the smallest k such that x^k+1 == P(x)*Q(x) for some Q(x) --> x^k+1 ~ 0 (mod P(x)) --> x^k ~ -1 (mod P(x)) --> x^k ~ 1 (mod P(x))
	// If the polynomial has terms up to x^34, then we have up to 2^34 polynomial remainders to consider before we get a repeat
	// We use "baby step giant step" as sort of a "meet in the middle" algorithm
	// -- We first try up through 1<<20 looking for a repeat
	// -- If we don't find one, then we consider x^k = x^(aB-c) where B = 1<<20.  Note in this case, x^k ~ 1 (mod P(x)) is equivalent to
	// -- x^(aB) ~ x^c (mod P(x)), so we just calculate x^B, x^(2B), x^(3B) and look for a match in the x^c hash

	doPolyMul := func(a,b,p,z int64) int64 {
		res := int64(0)
		for b > 0 {
			if b & 1 == 1 { res ^= a }
			a <<= 1
			if a > z { a ^= p }
			b >>= 1
		}
		return res
	}

	// Do the baby steps first
	z := int64(1); for 2*z <= p { z *= 2 } //
	baby := make(map[int64]int)
	m := int64(1); baby[m] = 0; good := true; ans := int64(-1)

	// Baby step portion
	for i:=1;i<=1<<20;i++ {
		m <<= 1; if m >= z { m ^= p }
		if m == 0 { good = false; break } // don't think this can happen, but checking just in case
		if m == 1 { ans = int64(i); break }
		baby[m] = i
	}
	if !good { fmt.Println(-1); return }
	if ans == -1 {
		// Giant step portion
		xx := m
		a := 1
		for {
			m = doPolyMul(m,xx,p,z); a++
			if m == 0 { good = false; break } // don't think this can happen, but checking just in case
			v,ok := baby[m]
			if ok { ans = int64(a)*int64(1<<20)-int64(v); break }
		}
	}
	if !good { fmt.Println(-1); return }
	fmt.Printf("%v %v\n",fo+1,int64(fo+1)+ans)
}


package main

import (
	"bufio"
	"os"
	"strconv"
)

func start() {
	s := sstring()
	n := len(s)
	if n == 1 {
		if s[0] == '0' || s[0] == '_' || s[0] == 'X' {
			wlstring("1")
			return
		} else {
			wlstring("0")
			return
		}
	}
	if s[0] == '0' {
		wlstring("0")
		return
	}
	hasX := 0
	for _, v := range s {
		if v == 'X' {
			hasX = 1
			break
		}
	}
	ltemps := []string{"00", "25", "50", "75"}
	ending := s[n-2 : n]
	rTot := 0
	for _, temp := range ltemps {
		tempOk, xVal := true, byte('a')
		for i := range ending {
			c := ending[i]
			if c == '_' {
			} else if c == 'X' {
				if xVal != 'a' && xVal != temp[i] {
					tempOk = false
					break
				}
				xVal = temp[i]
			} else {
				if c != temp[i] {
					tempOk = false
					break
				}
			}
		}
		//
		if tempOk {
			if s[0] == 'X' && xVal == '0' {
			} else {
				r := func() int {
					if n == 2 {
						return 1
					} else if s[0] == '_' {
						return 9
					} else {
						return 1
					}
				}()
				for i := 1; i < n-2; i++ {
					if s[i] == '_' {
						r *= 10
					}
				}
				rX := 1
				if hasX == 1 && xVal == 'a' {
					rX = 10
					if s[0] == 'X' {
						rX = 9
					}
				}
				rTot += r * rX
			}
		}
	}
	wlint(rTot)
}

func main() {
	start()
	// flush
	writer.Flush()
}

// utils
func max(a int, b int) int {
	if b > a {
		return b
	}
	return a
}

// io utils

var (
	scanner = bufio.NewScanner(os.Stdin)
	writer  = bufio.NewWriter(os.Stdout)
)

func wstring(s string) {
	writer.WriteString(s)
}
func wrune(r rune) {
	writer.WriteRune(r)
}
func wint(i int) {
	wstring(strconv.Itoa(i))
}
func wlstring(s string) {
	writer.WriteString(s)
	wrune('\n')
}
func wlrune(r rune) {
	writer.WriteRune(r)
	wrune('\n')
}
func wlint(i int) {
	wstring(strconv.Itoa(i))
	wrune('\n')
}

func init() {
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 4096), 1e9)
}

func printls(in []int) {
	for _, v := range in {
		wint(v)
		wrune(' ')
	}
	wlstring("")
}

func sint() int {
	i, err := strconv.Atoi(sstring())
	if err != nil {
		panic("sint: Error")
	}
	return i
}

func sints(n int) []int {
	a := make([]int, n)
	for i := range a {
		a[i] = sint()
	}
	return a
}

func sstring() string {
	if !scanner.Scan() {
		panic(scanner.Err())
	}
	return scanner.Text()
}


package main

import "fmt"

func main() {
	cnt, _ := fmt.Scan()
	for i := 0; i < cnt; i++ {
		k, _ := fmt.Scan()
		fmt.Println(playoff(k))
	}
}
func playoff(k int) int {
	n := 1
	for i := 1; i <= k; i++ {
		n = n * 2
	}
	return n - 1
}


package main
import(
    "fmt"
    "bufio"
    "os"
    "math"
)
type coords struct{
	row int
	column int
}
func main() {
	in:= bufio.NewReader(os.Stdin)
	out:= bufio.NewWriter(os.Stdout)
	defer out.Flush()
	var t int
	fmt.Fscan(in,&t)
	for i:=0;i<t;i++{
		var n float64
		fmt.Fscan(in,&n)
		n = math.Pow(float64(2),float64(n))
		fmt.Fprintln(out,n-1)
	}
}


package main

import (
    "fmt"
    "os"
    "math"
)

func main() {
    var t int
    fmt.Fscan(os.Stdin, &t)
    for i := 0; i < t; i++ {
        var n int
        fmt.Fscan(os.Stdin, &n)
        if n == 0 {
            fmt.Println(n)
        } else {
            r:= math.Pow(2, float64(n)) - float64(1)
            fmt.Println(r)
        }
    }
}


package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strconv"
	"strings"
)

func main() {
	reader := bufio.NewReader(os.Stdin)
	t := readInt(reader)
	for t > 0 {
		n := float64(readInt(reader))
		fmt.Println(math.Pow(2, n) - 1)
		t--
	}
}

// Thanks to user: gealbermorales for the valuable guidance with processing input using Go
// Functions are published at https://codeforces.com/blog/entry/94245

func readInt(in *bufio.Reader) int {
	nStr, _ := in.ReadString('\n')
	nStr = strings.ReplaceAll(nStr, "\r", "")
	nStr = strings.ReplaceAll(nStr, "\n", "")
	n, _ := strconv.Atoi(nStr)
	return n
}

func readLineNumbs(in *bufio.Reader) []string {
	line, _ := in.ReadString('\n')
	line = strings.ReplaceAll(line, "\r", "")
	line = strings.ReplaceAll(line, "\n", "")
	numbs := strings.Split(line, " ")
	return numbs
}

func debug(name string, a interface{}) {
	fmt.Printf("\n%s = %v \n", name, a)
}


package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
)

func memoizedCNK(memosize int) func(int, int) int {
	memo := make(map[int]map[int]int)
	for i := 0; i <= memosize; i++ {
		memo[i] = make(map[int]int)
	}
	var cnk func(int, int) int
	cnk = func(n, k int) int {
		if k < 0 || k > n {
			return 0
		}
		if n == 0 || k == 0 || k == n {
			return 1
		}
		val, ok := memo[n][k]
		if !ok {
			val = cnk(n-1, k-1) + cnk(n-1, k)
			memo[n][k] = val
		}
		return val
	}
	return cnk
}

func CNK(n, k int) int {
	if k < 0 || k > n {
		return 0
	}
	if n == 0 || k == 0 || k == n {
		return 1
	}

	return CNK(n-1, k-1) + CNK(n-1, k)

}

func Solve(reader io.Reader, writer io.Writer) {
	var n, k int
	fmt.Fscanf(reader, "%d %d\n", &n, &k)
	cnk := memoizedCNK(n)
	sum := 0
	for ; k >= 0; k-- {
		sum += cnk(n, k) % 1000000007
	}
	fmt.Fprintln(writer, sum)

}

func main() {
	// f, err := os.Open("data.txt")
	// if err != nil {
	// 	os.Exit(1)
	// }
	// defer f.Close()

	// reader := bufio.NewReader(f)
	reader := bufio.NewReader(os.Stdin)
	writer := bufio.NewWriter(os.Stdout)
	Solve(reader, writer)
	writer.Flush()

}


package main

import (
	"bufio"
	"fmt"
	"os"
)

const Mod = 998244353

func main() {
	defer _w.Flush()
	n, x := ReadInt(), ReadInt()

	var dp [501][501]int64
	dp[n][int64(0)] = int64(1)
	for i := n; i >= int64(2); i-- {
		for j := int64(0); j < x; j++ {
			nj := Min(x, j+i-int64(1))
			for k := int64(0); k <= n; k++ {
				dp[k][nj] += dp[i][j] * ModCombination(i, k) * ModPow(nj-j, i-k)
				dp[k][nj] %= Mod
			}
		}
	}
	ans := int64(0)
	for j := int64(0); j <= x; j++ {
		ans += dp[int64(0)][j]
		ans %= Mod
	}
	println(((ans % Mod) + Mod) % Mod)
}

func ModCombination(n, k int64) (ret int64) {
	if n < k {
		return int64(0)
	}
	for ret = int64(1); n > int64(0) || k > int64(0); n, k = n/Mod, k/Mod {
		ret = ret * fac[n%Mod] % Mod * finv[k%Mod] % Mod * finv[(n-k)%Mod] % Mod
	}
	return
}

const MAX = 5e6

var fac, finv, inv [MAX + 1]int64

func init() {
	fac[int64(0)], fac[int64(1)], finv[int64(0)], finv[int64(1)], inv[int64(1)] = int64(1), int64(1), int64(1), int64(1), int64(1)
	for i := int64(2); i <= MAX; i++ {
		fac[i], inv[i] = fac[i-int64(1)]*i%Mod, Mod-inv[Mod%i]*(Mod/i)%Mod
		finv[i] = finv[i-int64(1)] * inv[i] % Mod
	}
}

func ModPow(a, b int64) (x int64) {
	for x = int64(1); b > int64(0); b >>= int64(1) {
		if b&int64(1) == int64(1) {
			x = x * a % Mod
		}
		a = a * a % Mod
	}
	return
}

func Max(a, b int64) int64 { AMax(&a, b); return a }
func Min(a, b int64) int64 { AMin(&a, b); return a }
func AMax(p *int64, x int64) {
	if *p < x {
		*p = x
	}
}
func AMin(p *int64, x int64) {
	if *p > x {
		*p = x
	}
}
func Maxs(xs ...int64) int64 {
	for _, x := range xs[int64(1):] {
		AMax(&xs[int64(0)], x)
	}
	return xs[int64(0)]
}
func Mins(xs ...int64) int64 {
	for _, x := range xs[int64(1):] {
		AMin(&xs[int64(0)], x)
	}
	return xs[int64(0)]
}
func AMaxs(p *int64, xs ...int64) { AMax(p, Maxs(xs...)) }
func AMins(p *int64, xs ...int64) { AMin(p, Mins(xs...)) }

var _r, _w = bufio.NewReader(os.Stdin), bufio.NewWriter(os.Stdout)

func ReadString() (s string) { fmt.Fscan(_r, &s); return }
func ReadInt() (i int64)     { fmt.Fscan(_r, &i); return }
func ReadInts(n int64) (a []int64) {
	for ; n > int64(0); n-- {
		a = append(a, ReadInt())
	}
	return
}
func print(a ...interface{})   { fmt.Fprint(_w, a...) }
func println(a ...interface{}) { fmt.Fprintln(_w, a...) }
func prints(s []int64)         { v := fmt.Sprint(s); println(v[int64(1) : int64(len(v))-int64(1)]) }


package main

import (
	"bufio"
	"fmt"
	"os"
)

const Mod = 998244353

func main() {
	defer _w.Flush()
	n, x := int64(ReadInt()), int64(ReadInt())

	var dp [501][501]int64
	dp[n][0] = 1
	for i := int64(n); i >= 2; i-- {
		for j := int64(0); j < x; j++ {
			nj := Min(x, j+i-1)
			pow := int64(1)
			for k := i; k >= 0; k-- {
				dp[k][nj] += dp[i][j] * ModCombination(i, k) % Mod * pow
				dp[k][nj] %= Mod
				pow = pow * (nj - j) % Mod
			}
		}
	}
	ans := int64(0)
	for j := int64(0); j <= x; j++ {
		ans += dp[0][j]
		ans %= Mod
	}
	println(((ans % Mod) + Mod) % Mod)
}

func ModCombination(n, k int64) (ret int64) {
	if n < k {
		return int64(0)
	}
	for ret = int64(1); n > int64(0) || k > int64(0); n, k = n/Mod, k/Mod {
		ret = ret * fac[n%Mod] % Mod * finv[k%Mod] % Mod * finv[(n-k)%Mod] % Mod
	}
	return
}

const MAX = 500

var fac, finv, inv [MAX + 1]int64

func init() {
	fac[int64(0)], fac[int64(1)], finv[int64(0)], finv[int64(1)], inv[int64(1)] = int64(1), int64(1), int64(1), int64(1), int64(1)
	for i := int64(2); i <= MAX; i++ {
		fac[i], inv[i] = fac[i-int64(1)]*i%Mod, Mod-inv[Mod%i]*(Mod/i)%Mod
		finv[i] = finv[i-int64(1)] * inv[i] % Mod
	}
}

func Min(a, b int64) int64 {
	if a < b {
		return a
	}
	return b
}

var _r, _w = bufio.NewReader(os.Stdin), bufio.NewWriter(os.Stdout)

func ReadString() (s string)   { fmt.Fscan(_r, &s); return }
func ReadInt() (i int)         { fmt.Fscan(_r, &i); return }
func print(a ...interface{})   { fmt.Fprint(_w, a...) }
func println(a ...interface{}) { fmt.Fprintln(_w, a...) }
func prints(s []int64)         { v := fmt.Sprint(s); println(v[int64(1) : int64(len(v))-int64(1)]) }


package main

import (
	"bufio"
	"fmt"
	"os"
)

const Mod = 998244353

func main() {
	defer _w.Flush()
	solve()
}
func solve() {
	n, x := ReadInt(), ReadInt()
	var dp [501][501]int64
	for i := int64(2); i <= n; i++ {
		jj := Min(x, i-int64(1))
		for j := int64(1); j <= jj; j++ {
			// dp[i][j] = j^i - (j-1)^i
			dp[i][j] = ModPow(j, i) - ModPow(j-int64(1), i)
			dp[i][j] %= Mod
		}
	}

	for i := int64(2); i <= n; i++ {
		for j := int64(1); j <= x; j++ {
			for k := int64(0); k <= n-i; k++ {
				dp[i+k][j+i+k-int64(1)] += dp[i][j] * ModPow(i+k-int64(1), k) % Mod * ModCombination(i+k, k)
				dp[i+k][j+i+k-int64(1)] %= Mod
			}
		}
	}

	ans := int64(0)
	for j := int64(1); j <= x; j++ {
		ans += dp[n][j]
		ans %= Mod
	}
	println(((ans % Mod) + Mod) % Mod)
}

func ModCombination(n, k int64) (ret int64) {
	if n < k {
		return int64(0)
	}
	for ret = int64(1); n > int64(0) || k > int64(0); n, k = n/Mod, k/Mod {
		ret = ret * fac[n%Mod] % Mod * finv[k%Mod] % Mod * finv[(n-k)%Mod] % Mod
	}
	return
}

const MAX = 5e6

var fac, finv, inv [MAX + 1]int64

func init() {
	fac[int64(0)], fac[int64(1)], finv[int64(0)], finv[int64(1)], inv[int64(1)] = int64(1), int64(1), int64(1), int64(1), int64(1)
	for i := int64(2); i <= MAX; i++ {
		fac[i], inv[i] = fac[i-int64(1)]*i%Mod, Mod-inv[Mod%i]*(Mod/i)%Mod
		finv[i] = finv[i-int64(1)] * inv[i] % Mod
	}
}

func Max(a, b int64) int64 { AMax(&a, b); return a }
func Min(a, b int64) int64 { AMin(&a, b); return a }
func AMax(p *int64, x int64) {
	if *p < x {
		*p = x
	}
}
func AMin(p *int64, x int64) {
	if *p > x {
		*p = x
	}
}

func ModPow(a, b int64) (x int64) {
	for x = int64(1); b > int64(0); b >>= int64(1) {
		if b&int64(1) == int64(1) {
			x = x * a % Mod
		}
		a = a * a % Mod
	}
	return
}

var _r, _w = bufio.NewReader(os.Stdin), bufio.NewWriter(os.Stdout)

func ReadString() (s string) { fmt.Fscan(_r, &s); return }
func ReadInt() (i int64)     { fmt.Fscan(_r, &i); return }
func ReadInts(n int64) (a []int64) {
	for ; n > int64(0); n-- {
		a = append(a, ReadInt())
	}
	return
}
func print(a ...interface{})   { fmt.Fprint(_w, a...) }
func println(a ...interface{}) { fmt.Fprintln(_w, a...) }
func prints(s []int64)         { v := fmt.Sprint(s); println(v[int64(1) : int64(len(v))-int64(1)]) }


package main

import (
	"bufio"
	"fmt"
	"os"
)

const Mod = 998244353

func main() {
	defer _w.Flush()
	solve()
}
func solve() {
	n, x := ReadInt(), ReadInt()

	var pow [501][501]int64
	for i := int64(0); i < 501; i++ {
		pow[i][0] = 1
		for j := int64(0); j < 500; j++ {
			pow[i][j+1] = pow[i][j] * i % Mod
		}
	}

	var dp [501][501]int64
	for i := int64(2); i <= n; i++ {
		jj := Min(x, i-1)
		for j := int64(1); j <= jj; j++ {
			// dp[i][j] = j^i - (j-1)^i
			dp[i][j] = pow[j][i] - pow[j-1][i]
			dp[i][j] %= Mod
		}
	}

	for i := int64(2); i <= n; i++ {
		for j := int64(1); j <= x; j++ {
			if dp[i][j] == 0 {
				continue
			}
			for k := int64(0); k <= n-i; k++ {
				nj := j + i + k - 1
				if nj > x {
					break
				}
				dp[i+k][nj] += dp[i][j] * pow[i+k-1][k] % Mod * ModCombination(i+k, k)
				dp[i+k][nj] %= Mod
			}
		}
	}

	ans := int64(0)
	for j := int64(1); j <= x; j++ {
		ans += dp[n][j]
		ans %= Mod
	}
	println(((ans % Mod) + Mod) % Mod)
}

func ModCombination(n, k int64) (ret int64) {
	if n < k {
		return int64(0)
	}
	for ret = int64(1); n > int64(0) || k > int64(0); n, k = n/Mod, k/Mod {
		ret = ret * fac[n%Mod] % Mod * finv[k%Mod] % Mod * finv[(n-k)%Mod] % Mod
	}
	return
}

const MAX = 500

var fac, finv, inv [MAX + 1]int64

func init() {
	fac[int64(0)], fac[int64(1)], finv[int64(0)], finv[int64(1)], inv[int64(1)] = int64(1), int64(1), int64(1), int64(1), int64(1)
	for i := int64(2); i <= MAX; i++ {
		fac[i], inv[i] = fac[i-int64(1)]*i%Mod, Mod-inv[Mod%i]*(Mod/i)%Mod
		finv[i] = finv[i-int64(1)] * inv[i] % Mod
	}
}

func Max(a, b int64) int64 { AMax(&a, b); return a }
func Min(a, b int64) int64 { AMin(&a, b); return a }
func AMax(p *int64, x int64) {
	if *p < x {
		*p = x
	}
}
func AMin(p *int64, x int64) {
	if *p > x {
		*p = x
	}
}

var _r, _w = bufio.NewReader(os.Stdin), bufio.NewWriter(os.Stdout)

func ReadString() (s string) { fmt.Fscan(_r, &s); return }
func ReadInt() (i int64)     { fmt.Fscan(_r, &i); return }
func ReadInts(n int64) (a []int64) {
	for ; n > int64(0); n-- {
		a = append(a, ReadInt())
	}
	return
}
func print(a ...interface{})   { fmt.Fprint(_w, a...) }
func println(a ...interface{}) { fmt.Fprintln(_w, a...) }
func prints(s []int64)         { v := fmt.Sprint(s); println(v[int64(1) : int64(len(v))-int64(1)]) }