fun main() {
    fun readInts() = readLine()!!.split(" ").map(String::toInt)

    fun List<Int>.bsRight(value: Int): Int {
        var left = 0
        var right = this.lastIndex
        var pivot: Int
        while (left <= right) {
            pivot = (left + right) / 2
            if (this[pivot] > value) right = pivot - 1 else left = pivot + 1
        }
        return left - 1
    }

    val (numPoints, diameter) = readInts()
    val arr = readInts().sorted()
    val stop = arr.last() - diameter
    if (stop <= arr[0]) {
        print(0)
        return
    }
    var result = Integer.MAX_VALUE
    var left = -1
    var right: Int
    while (++left < numPoints && arr[left] <= stop) {
        right = arr.bsRight(arr[left] + diameter)
        val candidate = numPoints - right + left - 1
        if (candidate < result) result = candidate
    }
    if(left < numPoints) {
        right = arr.bsRight(arr[left] + diameter)
        val candidate = numPoints - right + left - 1
        if (candidate < result) result = candidate
    }
    print(result)
}

fun main(args: Array<String>){
	val string1: String = readLine().toString()
	var mnozh: List<Int> = readLine().toString().split(" ").map{x -> x.toInt()}
	val N = string1.split(" ")[0].toInt()
	val expD = string1.split(" ")[1].toInt()
	mnozh = mnozh.sorted()
	val D = mnozh.last() - mnozh.first()
	if (D <= expD){
		println(0)
	}else{
		//println("Expected: $expD, real: $D")
		var realD: Int
		var minDropped = 101
		var dropped: Int
		for (i in 0..N-1){
			for (j in i..N-1){
				realD = mnozh[j]-mnozh[i]
				dropped = N - (j - i + 1)
				if((realD <= expD) and (dropped <= minDropped)){
					minDropped = dropped
					//println("i: $i, j: $j, Distance: $realD, dropped: $dropped")
				}
			}
		}
		println(minDropped)
	}
}

fun main(args:Array<String>) {
  val (m,n) = readLine()!!.split(" ").map(String::toInt)

  val target = readLine()!!.split(" ").map(String::toInt).sorted()

  val ansbox = mutableListOf<Pair<Int,Int>>()

  for( start in (0..target.size-1) ) {
    for( end in (start..target.size-1) ) {
      val delta = target[end] - target[start]
      if( n >= delta ) {
        val ans = target.size - (end-start + 1)
        ansbox.add(Pair(delta, ans))
      }
    }
  }
  //println(ansbox)
  if(ansbox.minBy{ it.second } == null)
    if( m <= n )
      println(0)
    else if( n >= 1 )
      println(target.size - 1)
    else
      println(0)
  else
    println(ansbox.minBy{ it.second }!!.second)
}

import java.io.*
import java.util.*
import kotlin.math.min

fun main(args: Array<String>) {
    solve(System.`in`, System.out)
}

fun solve(input: InputStream, output: OutputStream) {
    val reader = InputReader(BufferedInputStream(input))
    val writer = PrintWriter(BufferedOutputStream(output))

    solve(reader, writer)
    writer.close()
}

fun solve(reader: InputReader, writer: PrintWriter) {
    val n = reader.nextInt()
    val d = reader.nextInt()

    val a = mutableMapOf<Int, Int>().toSortedMap()
    for (i in 0 until n) {
        val x = reader.nextInt()
        a.put(x, a.getOrDefault(x, 0) + 1)
    }

    if (a.size == 1) {
        writer.print("0")
        return
    }

    var ans = n
    for ((k, _) in a) {
        val c = a.filter { it.key < k || it.key > k + d }.map { it.value }.sum()
        ans = min(ans, c)
    }

    writer.print(ans)
}

class InputReader(stream: InputStream) {
    val reader: BufferedReader
    var tokenizer: StringTokenizer? = null

    init {
        reader = BufferedReader(InputStreamReader(stream), 32768)
        tokenizer = null
    }

    operator fun next(): String {
        while (tokenizer == null || !tokenizer!!.hasMoreTokens()) {
            try {
                tokenizer = StringTokenizer(reader.readLine())
            } catch (e: IOException) {
                throw RuntimeException(e)
            }

        }
        return tokenizer!!.nextToken()
    }

    fun nextInt(): Int {
        return Integer.parseInt(next())
    }

    fun nextLong(): Long {
        return java.lang.Long.parseLong(next())
    }

    fun nextArrayInt(count: Int): IntArray {
        return nextArrayInt(0, count)
    }

    fun nextArrayInt(start: Int, count: Int): IntArray {
        val a = IntArray(start + count)
        for (i in start until start + count) {
            a[i] = nextInt()
        }
        return a
    }

    fun nextArrayLong(count: Int): LongArray {
        val a = LongArray(count)
        for (i in 0 until count) {
            a[i] = nextLong()
        }
        return a
    }
}

import java.util.*

fun main(args: Array<String>) {
    val s = Scanner(System.`in`)
    val n = s.nextInt()
    val desiredDiameter = s.nextInt()
    val numbers = Array(n, { _ -> 0 })

    for (i in 0..n-1) {
        numbers[i] = s.nextInt()
    }

    numbers.sort()

    var from = 0
    var to = 0
    var optimalRemoved = Int.MAX_VALUE
    while (to <= numbers.lastIndex) {
        val d = numbers[to] - numbers[from]

        if (d <= desiredDiameter) {
            optimalRemoved = minOf(from + (numbers.size - to - 1), optimalRemoved)
        }

        if (d <= desiredDiameter) {
            to++
        } else {
            from++
        }
    }

    println(optimalRemoved)
}

import java.io.*
import java.util.*
import kotlin.math.min

fun main(args: Array<String>) {
    solve(System.`in`, System.out)
}

fun solve(input: InputStream, output: OutputStream) {
    val reader = InputReader(BufferedInputStream(input))
    val writer = PrintWriter(BufferedOutputStream(output))

    solve(reader, writer)
    writer.close()
}

fun solve(reader: InputReader, writer: PrintWriter) {
    val n = reader.nextInt()
    val d = reader.nextInt()

    val a = mutableMapOf<Int, Int>().toSortedMap()
    for (i in 0 until n) {
        val x = reader.nextInt()
        a.put(x, a.getOrDefault(x, 0) + 1)
    }

    if (a.size == 1) {
        writer.print("0")
        return
    }

    var ans = n
    var v = a.map { it.key }
    for (i in 0 until v.lastIndex) {
        val c = a.filter { it.key < v[i] || it.key > v[i] + d }.map { it.value }.sum()
        ans = min(ans, c)
    }

    writer.print(ans)
}

class InputReader(stream: InputStream) {
    val reader: BufferedReader
    var tokenizer: StringTokenizer? = null

    init {
        reader = BufferedReader(InputStreamReader(stream), 32768)
        tokenizer = null
    }

    operator fun next(): String {
        while (tokenizer == null || !tokenizer!!.hasMoreTokens()) {
            try {
                tokenizer = StringTokenizer(reader.readLine())
            } catch (e: IOException) {
                throw RuntimeException(e)
            }

        }
        return tokenizer!!.nextToken()
    }

    fun nextInt(): Int {
        return Integer.parseInt(next())
    }

    fun nextLong(): Long {
        return java.lang.Long.parseLong(next())
    }

    fun nextArrayInt(count: Int): IntArray {
        return nextArrayInt(0, count)
    }

    fun nextArrayInt(start: Int, count: Int): IntArray {
        val a = IntArray(start + count)
        for (i in start until start + count) {
            a[i] = nextInt()
        }
        return a
    }

    fun nextArrayLong(count: Int): LongArray {
        val a = LongArray(count)
        for (i in 0 until count) {
            a[i] = nextLong()
        }
        return a
    }
}

fun main() {
    fun readInts() = readLine()!!.split(" ").map(String::toInt)

    fun List<Int>.bsRight(value: Int): Int {
        var left = 0
        var right = this.lastIndex
        var pivot: Int
        while (left <= right) {
            pivot = (left + right) / 2
            if (this[pivot] > value) right = pivot - 1 else left = pivot + 1
        }
        return left - 1
    }

    val (numPoints, diameter) = readInts()
    val arr = readInts().sorted()
    val stop = arr.last() - diameter
    if (stop <= arr[0]) {
        print(0)
        return
    }
    var result = Integer.MAX_VALUE
    var left = -1
    var right: Int
    while (++left < numPoints && arr[left] <= stop) {
        right = arr.bsRight(arr[left] + diameter)
        val candidate = numPoints - right + left - 1
        if (candidate < result) result = candidate
    }
    print(result)
}

fun main() {
    fun readInts() = readLine()!!.split(" ").map(String::toInt)

    fun List<Int>.bsRight(value: Int): Int {
        var left = 0
        var right = this.lastIndex
        var pivot: Int
        while (left <= right) {
            pivot = (left + right) / 2
            if (this[pivot] > value) right = pivot - 1 else left = pivot + 1
        }
        return left - 1
    }

    val (numPoints, diameter) = readInts()
    val arr = readInts().sorted()
    val stop = arr.last() - diameter
    var result = Integer.MAX_VALUE
    var left = -1
    var right: Int
    while (++left < numPoints && arr[left] <= stop) {
        right = arr.bsRight(arr[left] + diameter)
        val candidate = numPoints - right + left - 1
        if (candidate < result) result = candidate
    }
    print(result)
}

fun main(args:Array<String>) {
  val (m,n) = readLine()!!.split(" ").map(String::toInt)

  val target = readLine()!!.split(" ").map(String::toInt).sorted()

  val ansbox = mutableListOf<Int>()

  for( start in (0..target.size-1) ) {
    for( end in (start..target.size-1) ) {
      val delta = target[end] - target[start]
      if( n == delta ) {
        val ans = target.size - (end-start + 1)
        ansbox.add(ans)
      }
    }
  }
  if(ansbox.min() == null)
    println(0)
  else
    println(ansbox.min()!!)
}

fun main(args:Array<String>) {
  val (m,n) = readLine()!!.split(" ").map(String::toInt)

  val target = readLine()!!.split(" ").map(String::toInt).sorted()

  val ansbox = mutableListOf<Int>()

  for( start in (0..target.size-1) ) {
    for( end in (start..target.size-1) ) {
      val delta = target[end] - target[start]
      if( n == delta ) {
        val ans = target.size - (end-start + 1)
        ansbox.add(ans)
      }
    }
  }
  if(ansbox.min() == null)
    if( m <= n )
      println(0)
    else if( n >= 1 )
      println(target.size - 1)
    else
      println(0)
  else
    println(ansbox.min()!!)
}

fun main(args:Array<String>) {
  val (m,n) = readLine()!!.split(" ").map(String::toInt)

  val target = readLine()!!.split(" ").map(String::toInt).sorted()

  val ansbox = mutableListOf<Int>()

  for( start in (0..target.size-1) ) {
    for( end in (start..target.size-1) ) {
      val delta = target[end] - target[start]
      if( n == delta ) {
        val ans = target.size - (end-start + 1)
        ansbox.add(ans)
      }
    }
  }
  if(ansbox.min() == null)
    if( n == 1 )
      println(target.size - 1)
    else
      println(0)
  else
    println(ansbox.min()!!)
}

fun main(args:Array<String>) {
  val (m,n) = readLine()!!.split(" ").map(String::toInt)

  val target = readLine()!!.split(" ").map(String::toInt).sorted()

  val ansbox = mutableListOf<Int>()

  for( start in (0..target.size-1) ) {
    for( end in (start..target.size-1) ) {
      val delta = target[end] - target[start]
      if( n == delta ) {
        val ans = target.size - (end-start + 1)
        ansbox.add(ans)
      }
    }
  }
  println(ansbox.min())
}

fun main(args:Array<String>) {
  val (m,n) = readLine()!!.split(" ").map(String::toInt)

  val target = readLine()!!.split(" ").map(String::toInt).sorted()

  val ansbox = mutableListOf<Int>()

  for( start in (0..target.size-1) ) {
    for( end in (start..target.size-1) ) {
      val delta = target[end] - target[start]
      if( n == delta ) {
        val ans = target.size - (end-start + 1)
        ansbox.add(ans)
      }
    }
  }
  if(ansbox.min() == null)
    if( n >= 1 )
      println(target.size - 1)
    else
      println(0)
  else
    println(ansbox.min()!!)
}

fun main(args:Array<String>) {
  val (m,n) = readLine()!!.split(" ").map(String::toInt)

  val target = readLine()!!.split(" ").map(String::toInt).sorted()

  val ansbox = mutableListOf<Int>()

  for( start in (0..target.size-1) ) {
    for( end in (start..target.size-1) ) {
      val delta = target[end] - target[start]
      if( n == delta ) {
        val ans = target.size - (end-start + 1)
        ansbox.add(ans)
      }
    }
  }
  if(ansbox.min() == null)
    if( m < n )
      println(0)
    else if( n >= 1 )
      println(target.size - 1)
    else
      println(0)
  else
    println(ansbox.min()!!)
}

fun main(args: Array<String>){
	val string1: String = readLine().toString()
	var mnozh: List<Int> = readLine().toString().split(" ").map{x -> x.toInt()}
	val N = string1.split(" ")[0].toInt()
	val expD = string1.split(" ")[1].toInt()
	mnozh = mnozh.sorted()
	val D = mnozh.last() - mnozh.first()
	if (D <= expD){
		println(0)
	}else{
		//println("Expected: $expD, real: $D")
		var realD: Int
		var minDropped = 101
		var dropped: Int
		for (i in 0..N-2){
			for (j in i+1..N-1){
				realD = mnozh[j]-mnozh[i]
				dropped = N - (j - i + 1)
				if((realD <= expD) and (dropped <= minDropped)){
					minDropped = dropped
					//println("i: $i, j: $j, Distance: $realD, dropped: $dropped")
				}
			}
		}
		println(minDropped)
	}
}


import java.io.PrintWriter
import kotlin.math.*

fun main() {
    io.apply {

        val d = ints()
        val i0 = d.indexOf(1)
        val i1 = d.indexOf(d.size)
        val m0 = min(i0, i1)
        val m1 = max(i0, i1)
        cout .. max(d.size - 1 - m0, m1) .. nl

    }.cout.flush()
}

// @formatter:off
private val io = object {
    private val `in` = System.`in`
    private fun ll(): Long {
        var x: Int; var q = false; var n = 0L; do x = `in`.read() while (x < 33); if (x == 45) { q = true; x = `in`.read() }
        do { n = n * 10 - x + 48; x = `in`.read() } while (x > 32); return if (q) n else -n
    }
    val int get() = ll().toInt(); val long get() = ll()
    fun ints(n: Int = int): IntArray { return IntArray(n) { int } }
    fun ints1(n: Int = int): IntArray { return IntArray(n) { int - 1 } }
    val cout = PrintWriter(System.out); val nl = "\n"
    private var buf = CharArray(32)
    private var bufSize = 32
    fun str(expect: Int = 32): String {
        var ix = 0
        var x: Int
        if (bufSize < expect)
            buf = CharArray(expect)
        do x = `in`.read() while (x < 33)
        do {
            if (ix == bufSize) { bufSize *= 2; buf = buf.copyOf(bufSize) }
            buf[ix++] = x.toChar()
            x = `in`.read()
        } while (x > 32)
        return java.lang.String.copyValueOf(buf, 0, ix)
    }
    operator fun PrintWriter.rangeTo(a: Int): PrintWriter { print(a); print(" "); return this }
    operator fun PrintWriter.rangeTo(a: Long): PrintWriter { print(a); print(" "); return this }
    operator fun PrintWriter.rangeTo(a: IntArray): PrintWriter { a.forEach { print(it); print(" ") }; return this }
    operator fun PrintWriter.rangeTo(a: String): PrintWriter { write(a); return this }
} // @formatter:on

/* ----------- */

import kotlin.math.min

fun main() {
    val size = readLine()!!.toInt()
    val arr = readLine()!!.split(" ").map { it.toInt() }
    val minPos = arr.indexOf(1)
    val maxPos = arr.indexOf(size)
    val closer = min(minPos, min(size - 1 - minPos, min(maxPos, size - 1 - maxPos)))
    print(size - 1 - closer)
}

import kotlin.math.min

fun main() {
    fun readInt() = readLine()!!.toInt()
    fun readInts() = readLine()!!.split(" ").map(String::toInt)

    val size = readInt()
    val arr = readInts()
    val minPos = arr.indexOf(1)
    val maxPos = arr.indexOf(size)
    val closer = min(minPos, min(size - 1 - minPos, min(maxPos, size - 1 - maxPos)))
    print(size - 1 - closer)
}

import java.lang.Integer.max
import java.util.*

fun main() {
    val scanner = Scanner(System.`in`)
    val n = scanner.nextInt()
    var minElement = Int.MAX_VALUE
    var maxElement = Int.MIN_VALUE
    var minElementPos = -1
    var maxElementPos = -1

    repeat (n) {
        val current = scanner.nextInt()
        if (current < minElement) {
            minElement = current
            minElementPos = it
        }

        if (current > maxElement) {
            maxElement = current
            maxElementPos = it
        }
    }

    if (minElementPos < maxElementPos) {
        println(max(maxElementPos, n - 1 - minElementPos))
    } else {
        println(max(minElementPos, n - 1 - maxElementPos))
    }
}

import java.lang.Integer.max
import java.util.*

fun main() {
    val scanner = Scanner(System.`in`)
    val n = scanner.nextInt()
    var minElement = Int.MAX_VALUE
    var maxElement = Int.MIN_VALUE
    var minElementPos = -1
    var maxElementPos = -1

    repeat (n) {
        val current = scanner.nextInt()
        if (current < minElement) {
            minElement = current
            minElementPos = it
        } else if (current > maxElement) {
            maxElement = current
            maxElementPos = it
        }
    }

    if (minElementPos < maxElementPos) {
        println(max(maxElementPos, n - 1 - minElementPos))
    } else {
        println(max(minElementPos, n - 1 - maxElementPos))
    }
}


import java.util.*

fun main() {
    var w: Int
    var h: Int

    with(Scanner(System.`in`)) {
        w = nextInt()
        h = nextInt()
    }

    var count = 0L

    for (i in w / 2 downTo 1 step 1) {
        for (j in h / 2 downTo 1 step 1) {
            count += (w - i * 2 + 1) * (h - j * 2 +1)
        }
    }
    print(count)
}

import java.util.*

fun main() {

    val scanner = Scanner(System.`in`)

    val w = scanner.nextInt()
    val h = scanner.nextInt()

    var ans: Long = 0

    for (x in 0..w) {
        for (y in 0..h) {
            if (x % 2 == 0 && y % 2 == 0 && x > 0 && y > 0) {
                ans += (w - x + 1) * (h - y + 1)
            }
        }
    }

    println(ans)

}

import java.util.*

fun main() {
    var w: Int
    var h: Int

    with(Scanner(System.`in`)) {
        w = nextInt()
        h = nextInt()
    }

    var count = 0

    for (i in w / 2 downTo 1 step 1) {
        for (j in h / 2 downTo 1 step 1) {
            count += (w - i * 2 + 1) * (h - j * 2 +1)
        }
    }
    print(count)
}


import java.io.BufferedReader
import java.io.InputStream
import java.io.InputStreamReader
import java.util.*
import kotlin.collections.ArrayList
import kotlin.math.sqrt

fun main() {
    val sc = Scanner.sysIn

    val x = sc.nextInt()
    val n = sc.nextLong()

    val primes = ArrayList<Int>()

    fun isPrime(k: Int): Boolean {
        if (k == 1) return false
        if (k == 2 || k == 3) return true
        for (i in 2..sqrt(k.toDouble()).toInt()) {
            if (k % i == 0) {
                return false
            }
        }
        return true

    }

    for (i in 2..sqrt(x.toDouble()).toInt()) {
        if (x % i == 0) {
            if (isPrime(i) && !primes.contains(x / i))
                primes += i
            if (isPrime(x / i) && !primes.contains(x / i))
                primes += x / i
        }
    }
    if (isPrime(x)) primes += x

    //primes.forEach { println(it) }

    val mod = 1000000007
    fun power(x: Long, p: Long): Long = when {
        p == 0L -> 1
        p == 1L -> x % mod
        p % 2 == 0L -> {
            val cur = power(x, p / 2)
            (cur * cur) % mod
        }
        else -> (power(x, p - 1) * x) % mod
    }

    var ans = 1L

    for (p in primes) {
        var curP = p.toLong()
        while (n / curP > 0) {
            //println(curP)
            ans = (ans * power(p.toLong(), n / curP)) % mod
            if ((curP * p) / p != curP) break
            curP *= p
        }
    }

    println(ans)
}

class Scanner(s: InputStream) {
    var st: StringTokenizer? = null
    val br: BufferedReader = BufferedReader(InputStreamReader(s))

    operator fun next(): String {
        while (st == null || !st!!.hasMoreTokens())
            st = StringTokenizer(br.readLine())
        return st!!.nextToken()
    }

    fun nextInt(): Int {
        return Integer.parseInt(next())
    }

    fun nextLong(): Long {
        return java.lang.Long.parseLong(next())
    }

    fun nextLine(): String {
        return br.readLine()
    }

    fun nextDouble(): Double {
        return java.lang.Double.parseDouble(next())
    }

    companion object {
        val sysIn = Scanner(System.`in`)
    }

}

val rnd = Random()
fun IntArray.sort() {
    val n = this.size
    for (i in 0 until n - 1) {
        val randomPos = i + rnd.nextInt(n - i - 1) + 1
        this[i] = this[i] xor this[randomPos]
        this[randomPos] = this[randomPos] xor this[i]
        this[i] = this[i] xor this[randomPos]
    }
    Arrays.sort(this)
}

fun LongArray.sort() {
    val n = this.size
    for (i in 0 until n - 1) {
        val randomPos = i + rnd.nextInt(n - i - 1) + 1
        this[i] = this[i] xor this[randomPos]
        this[randomPos] = this[randomPos] xor this[i]
        this[i] = this[i] xor this[randomPos]
    }
    Arrays.sort(this)
}

import java.io.BufferedReader
import java.io.InputStream
import java.io.InputStreamReader
import java.util.*
import kotlin.math.abs
import kotlin.math.max
import kotlin.math.min

val MOD = 1_000_000_007
fun factorize(a: Int): MutableMap<Int, Int> {
  val res = mutableMapOf<Int, Int>()
  var x = a
  loop@while(x > 1) {
    var i = 2
    while(i * i <= x) {
      if (x % i == 0) {
        res.merge(i, 1, Int::plus)
        x /= i
        continue@loop
      }
      i++
    }
    res.merge(x, 1, Int::plus)
    x = 0
  }
  return res
}
fun powMod(a: Int, n: Long, mod: Int): Long {
  if (n == 0L) return 1
  val res = powMod((a.toLong() * a % mod).toInt(), n / 2, mod)
  return if (n % 2 == 1L) res * a % mod else res
}
class Solver(stream: InputStream, private val out: java.io.PrintWriter) {
  fun solve() {
    val X = ni()
    val N = nl()

    val fs = factorize(X)
    var ans = 1L
    for ((p, _) in fs) {
      var n = N
      while(n >= p) {
        n /= p
        ans = ans * powMod(p, n, MOD) % MOD
      }
    }

    out.println(ans)
  }

  private val isDebug = try {
    // なんか本番でエラーでる
    System.getenv("MY_DEBUG") != null
  } catch (t: Throwable) {
    false
  }

  private var tokenizer: StringTokenizer? = null
  private val reader = BufferedReader(InputStreamReader(stream), 32768)
  private fun next(): String {
    while (tokenizer == null || !tokenizer!!.hasMoreTokens()) {
      tokenizer = StringTokenizer(reader.readLine())
    }
    return tokenizer!!.nextToken()
  }

  private fun ni() = next().toInt()
  private fun nl() = next().toLong()
  private fun ns() = next()
  private fun na(n: Int, offset: Int = 0): IntArray {
    return map(n) { ni() + offset }
  }
  private fun nal(n: Int, offset: Int = 0): LongArray {
    val res = LongArray(n)
    for (i in 0 until n) {
      res[i] = nl() + offset
    }
    return res
  }

  private fun na2(n: Int, offset: Int = 0): Array<IntArray> {
    val a  = Array(2){IntArray(n)}
    for (i in 0 until n) {
      for (e in a) {
        e[i] = ni() + offset
      }
    }
    return a
  }

  private inline fun map(n: Int, f: (Int) -> Int): IntArray {
    val res = IntArray(n)
    for (i in 0 until n) {
      res[i] = f(i)
    }
    return res
  }

  private inline fun debug(msg: () -> String) {
    if (isDebug) System.err.println(msg())
  }

  private fun debug(a: LongArray) {
    debug { a.joinToString(" ") }
  }

  private fun debug(a: IntArray) {
    debug { a.joinToString(" ") }
  }

  private fun debug(a: BooleanArray) {
    debug { a.map { if (it) 1 else 0 }.joinToString("") }
  }

  private fun debugDim(A: Array<IntArray>) {
    if (isDebug) {
      for (a in A) {
        debug(a)
      }
    }
  }

  /**
   * 勝手にimport消されるのを防ぎたい
   */
  private fun hoge() {
    min(1, 2)
    max(1, 2)
    abs(-10)
  }
}

fun main() {
  val out = java.io.PrintWriter(System.out)
  Solver(System.`in`, out).solve()
  out.flush()
}

import java.util.*
import kotlin.math.sqrt

const val mod = 1000000007L

fun main() {
    val s = Scanner(System.`in`)
    val x = s.nextLong()
    val n = s.nextLong()

    var ans = 1L
    val primes = getPrimes(x)
    primes.forEach {
        var itt = it
        var cnt = 0L
        while (true) {
            cnt += n / itt
            if (itt <= n / it) // 如果直接itt*=it再判断itt<=n会爆Long
                itt *= it
            else
                break
        }
        ans = ans * fpow(it, cnt) % mod
    }
    print(ans)
}

fun getPrimes(x: Long): Set<Long> {
    val primes = MutableList(0) { 0L }

    val sqrtx = sqrt(x.toDouble()).toLong() + 5
    var xx = x
    var i = 2L
    while (xx > 1) {
        if (xx % i == 0L)
            primes.add(i)
        while (xx % i == 0L)
            xx /= i
        if (++i > sqrtx)
            break
    }
    if (xx > 1)
        primes.add(xx)

    return primes.toSet()
}
fun fpow(x: Long, n: Long, m: Long = mod): Long {
    if (n == 0L)
        return 1
    var ans = 1L
    var xx = x % mod
    var nn = n
    while (nn > 1) {
        if (nn % 2 == 1L)
            ans = ans * xx % mod
        nn /= 2
        xx = xx * xx % mod
    }
    return ans * xx % mod
}

import java.io.PrintWriter
import java.util.StringTokenizer

fun main() {
    output {
        val x = readInt()
        val n = readLong()

        val primes = x.factorize().distinct().toList()

        var ans = ModInt(1)

        for(p in primes) {
            var k = 0L
            var nn = n
            while(nn > 0) {
                nn /= p
                k += nn
            }
            ans *= ModInt(p).pow(k)
        }

        println(ans)
    }
}

fun Int.factorize() = sequence {
    var n = this@factorize

    for(p in 2..Int.MAX_VALUE) {
        if(p * p > n) break
        while(n % p == 0) {
            yield(p)
            n /= p
        }
    }

    if(n > 1) yield(n)
}

const val BILLION7 = 1e9.toInt() + 7
const val MODINT_BASE = BILLION7

inline infix fun Int.umod(base: Int) = Math.floorMod(this, base)
inline infix fun Long.umod(base: Long) = Math.floorMod(this, base)
inline infix fun Long.umod(base: Int) = Math.floorMod(this, base.toLong()).toInt()

fun Int.mulMod(other: Int, mod: Int) = (toLong() * other).umod(mod)

fun Int.powMod(exponent: Int, mod: Int): Int {
    var res = 1L
    var e = exponent
    var b = umod(mod).toLong()

    while(e > 0) {
        if(e and 1 == 1) {
            res = res * b % mod
        }
        e = e shr 1
        b = b * b % mod
    }
    return res.toInt()
}

inline fun Int.toModInt() = ModInt(this umod MODINT_BASE)
inline fun Long.toModInt() = ModInt(this umod MODINT_BASE)

/** note: Only use constructor for int within modulo range, otherwise use toModInt **/
inline class ModInt(val int: Int) {
    companion object {
        /** can't seem to make these private or inlined without causing compiler issues */
        @JvmField val _invMemo = HashMap<ModInt, ModInt>()
        fun _invMemoized(m: ModInt) = _invMemo.getOrPut(m) { m.inv_unmemoized() }
    }

    inline operator fun plus(other: ModInt) = plus(other.int) // MODINT_BASE < 2^30
    inline operator fun plus(other: Int) =  (int + other).toModInt() // careful of possible overflow
    inline operator fun inc() = plus(1)

    inline operator fun minus(other: ModInt) = minus(other.int)
    inline operator fun minus(other: Int) = (int - other).toModInt()
    inline operator fun dec() = minus(1)
    operator fun unaryMinus() = if(int == 0) this else ModInt(MODINT_BASE - int)

    inline operator fun times(other: ModInt) = times(other.int)
    inline operator fun times(other: Int) = ModInt(int.mulMod(other, MODINT_BASE))

    fun pow(exponent: Int): ModInt {
        val e = if(exponent < 0) exponent umod MODINT_BASE - 1 else exponent // assumes MODINT_BASE is prime
        return ModInt(int.powMod(e, MODINT_BASE))
    }

    fun pow(exponent: Long) = pow(exponent umod MODINT_BASE - 1) // assumes MODINT_BASE is prime

    inline fun inverse() = inv_memoized() /** NOTE: Change if necessary */

    fun inv_unmemoized(): ModInt {
        require(int != 0) { "Can't invert/divide by 0" }
        return pow(MODINT_BASE - 2) // assumes MODINT_BASE is prime
    }
    inline fun inv_memoized() = _invMemoized(this)

    operator fun div(other: ModInt) = times(other.inverse())
    inline operator fun div(other: Int) = div(other.toModInt())

    override fun toString() = int.toString()
}

inline class ModIntArray(val intArray: IntArray): Collection<ModInt> {
    inline operator fun get(i: Int) = ModInt(intArray[i])
    inline operator fun set(i: Int, v: ModInt) { intArray[i] = v.int }

    override val size: Int get() = intArray.size
    inline val lastIndex get() = intArray.lastIndex

    override fun contains(element: ModInt): Boolean = any { it == element }

    override fun containsAll(elements: Collection<ModInt>): Boolean = elements.all(::contains)

    override fun isEmpty(): Boolean = intArray.isEmpty()

    override fun iterator(): Iterator<ModInt> = object: Iterator<ModInt> {
        var index = 0
        override fun hasNext(): Boolean = index < size
        override fun next(): ModInt = get(index++)
    }
}
fun ModIntArray(capacity: Int) = ModIntArray(IntArray(capacity))
inline fun ModIntArray(capacity: Int, init: (Int) -> ModInt) =
    ModIntArray(IntArray(capacity) { init(it).int })

/** IO code start */
@JvmField val _reader = System.`in`.bufferedReader()
fun readLine(): String? = _reader.readLine()
fun readLn() = _reader.readLine()!!
@JvmField var _tokenizer: StringTokenizer = StringTokenizer("")
fun read(): String {
    while (_tokenizer.hasMoreTokens().not()) _tokenizer = StringTokenizer(_reader.readLine() ?: return "", " ")
    return _tokenizer.nextToken()
}
fun readInt() = read().toInt()
fun readDouble() = read().toDouble()
fun readLong() = read().toLong()
fun readStrings(n: Int) = List(n) { read() }
fun readInts(n: Int) = List(n) { read().toInt() }
fun readDoubles(n: Int) = List(n) { read().toDouble() }
fun readLongs(n: Int) = List(n) { read().toLong() }

@JvmField val _writer = PrintWriter(System.out, false)
inline fun output(block: PrintWriter.()->Unit) { _writer.apply(block).flush() }
fun iprintln(o: Any?) { println(o) } // immediate println for interactive, bypasses output{} blocks

import java.util.*
import kotlin.collections.HashSet
import kotlin.math.max

fun readInts() = readLine()!!.split(" ").map { it.toInt() }
fun readLongs() = readLine()!!.split(" ").map { it.toLong() }
fun readInt() = readLine()!!.toInt()
fun readLong() = readLine()!!.toLong()
fun readLenAndInts() = readLine()!!.split(" ").drop(1).map { it.toInt() }

fun divisors(xx : Int) : List<Int> {
    var x = xx
    val res = mutableListOf<Int>()
    fun tryDiv(div : Int) {
        if (x % div == 0) {
            res.add(div)
            do {
                x /= div
            } while (x % div == 0)
        }
    }
    tryDiv(2)
    var div = 3
    while(div * div <= x) {
        tryDiv(div)
        div += 2
    }
    if (x != 1) {
        res.add(x)
    }
    return res
}

val mod = 1000000007L
fun fastExp(a : Long, b : Long) : Long {
    //(a ^ b) % mod
    var res = 1L
    var x   = a
    var e   = b
    while(e > 0) {
        if (e % 2L == 1L) {
            res *= x
            res %= mod
        }
        x *= x
        x %= mod
        e /= 2
    }
    return res
}

fun main() {
    var (x,n) = readLongs()
    var res = 1L
    for(div in divisors(x.toInt())) {
        var times = 0L
        var nn = n
        while (nn > 0) {
            nn /= div
            times += nn
        }
        res *= fastExp(div.toLong(),times)
        res %= mod
    }
    println(res)
}

import kotlin.math.sqrt

fun main() {
    val (x, n) = readLongs()
    val primes = primes(x.toInt())
    var result = 1L
    for (prime in primes) {
        var num = n
        var count = 0L
        while (num >= prime) {
            count += num / prime
            num /= prime
        }
        result = (result * pow(prime.toLong(), count)) % 1000000007
    }
    println(result)
}

fun primes(x: Int): IntArray {
    var num = x
    val result = mutableListOf<Int>()
    for (i in 2..sqrt(x.toDouble()).toInt()) {
        if (num % i == 0) {
            result.add(i)
            num /= i
            while (num % i == 0) {
                num /= i
            }
        }
    }
    if (num != 1) {
        result.add(num)
    }
    return result.toIntArray()
}

fun pow(x: Long, n: Long): Long {
    var num = x
    var count = n
    var result = 1L
    while (count > 0) {
        if (count and 1L == 1L) {
            result = (result * num) % 1000000007
        }
        num = (num * num) % 1000000007
        count = count shr 1
    }
    return result
}

private fun readString() = readLine()!!

private fun readInt() = readString().toInt()

private fun readInts() = readString().split(" ").map { it.toInt() }

private fun readLong() = readString().toLong()

private fun readLongs() = readString().split(" ").map { it.toLong() }

import java.util.*
import kotlin.math.sqrt

const val mod = 1000000007L

fun main() {
    val s = Scanner(System.`in`)
    val x = s.nextLong()
    val n = s.nextLong()

    var ans = 1L
    val primes = getPrimes(x)
    primes.forEach {
        var itt = it
        var cnt = 0L
        while (true) {
            cnt += n / itt
            if (itt <= n / it) // 如果直接itt*=it再判断itt<=n会爆Long
                itt *= it
            else
                break
        }
        ans = ans * fpow(it, cnt) % mod
    }
    print(ans)
}

fun getPrimes(x: Long): Set<Long> {
    val primes = MutableList(0) { 0L }

    val sqrtx = sqrt(x.toDouble()).toLong()
    var xx = x
    var i = 2L
    while (xx in 2..sqrtx + 10) {
        if (xx % i == 0L)
            primes.add(i)
        while (xx % i == 0L)
            xx /= i
        i++
    }
    if (xx > 1)
        primes.add(xx)

    return primes.toSet()
}
fun fpow(x: Long, n: Long, m: Long = mod): Long {
    if (n == 0L)
        return 1
    var ans = 1L
    var xx = x % mod
    var nn = n
    while (nn > 1) {
        if (nn % 2 == 1L)
            ans = ans * xx % mod
        nn /= 2
        xx = xx * xx % mod
    }
    return ans * xx % mod
}

import java.io.BufferedReader
import java.io.InputStream
import java.io.InputStreamReader
import java.util.*
import kotlin.collections.ArrayList
import kotlin.math.sqrt

fun main() {
    val sc = Scanner.sysIn

    val x = sc.nextInt()
    val n = sc.nextLong()

    val primes = ArrayList<Int>()

    for (i in 2..sqrt(x.toDouble()).toInt() + 10) {
        if (x % i == 0) {
            var isPrime = true
            primes.forEach { if (i % it == 0) isPrime = false }
            if (isPrime)
                primes += i
        }
    }
    if (primes.isEmpty()) primes += x

    val mod = 1000000007
    fun power(x: Long, p: Long): Long = when {
        p == 0L -> 1
        p == 1L -> x % mod
        p % 2 == 0L -> {
            val cur = power(x, p / 2)
            (cur * cur) % mod
        }
        else -> (power(x, p - 1) * x) % mod
    }

    var ans = 1L

    for (p in primes) {
        //println(p)
        var num = 0L
        var curP = p.toLong()
        while (n / curP > 0) {
            //println(curP)
            num += n / curP
            if (curP * p / p != curP) break
            curP *= p
        }
        ans = ans * power(p.toLong(), num) % 1000000007
    }

    println(ans)
}

class Scanner(s: InputStream) {
    var st: StringTokenizer? = null
    val br: BufferedReader = BufferedReader(InputStreamReader(s))

    operator fun next(): String {
        while (st == null || !st!!.hasMoreTokens())
            st = StringTokenizer(br.readLine())
        return st!!.nextToken()
    }

    fun nextInt(): Int {
        return Integer.parseInt(next())
    }

    fun nextLong(): Long {
        return java.lang.Long.parseLong(next())
    }

    fun nextLine(): String {
        return br.readLine()
    }

    fun nextDouble(): Double {
        return java.lang.Double.parseDouble(next())
    }

    companion object {
        val sysIn = Scanner(System.`in`)
    }

}

val rnd = Random()
fun IntArray.sort() {
    val n = this.size
    for (i in 0 until n - 1) {
        val randomPos = i + rnd.nextInt(n - i - 1) + 1
        this[i] = this[i] xor this[randomPos]
        this[randomPos] = this[randomPos] xor this[i]
        this[i] = this[i] xor this[randomPos]
    }
    Arrays.sort(this)
}

fun LongArray.sort() {
    val n = this.size
    for (i in 0 until n - 1) {
        val randomPos = i + rnd.nextInt(n - i - 1) + 1
        this[i] = this[i] xor this[randomPos]
        this[randomPos] = this[randomPos] xor this[i]
        this[i] = this[i] xor this[randomPos]
    }
    Arrays.sort(this)
}

import java.io.BufferedReader
import java.io.InputStream
import java.io.InputStreamReader
import java.util.*
import kotlin.collections.ArrayList
import kotlin.math.sqrt

fun main() {
    val sc = Scanner.sysIn

    val x = sc.nextInt()
    val n = sc.nextLong()

    val primes = ArrayList<Int>()

    for (i in 2..sqrt(x.toDouble()).toInt() + 1) {
        if (x % i == 0) {
            var isPrime = true
            primes.forEach { if (i % it == 0) isPrime = false }
            if (isPrime)
                primes += i
        }
    }
    if (primes.isEmpty()) primes += x

    //primes.forEach { println(it) }

    val mod = 1000000007
    fun power(x: Long, p: Long): Long = when {
        p == 0L -> 1
        p == 1L -> x % mod
        p % 2 == 0L -> {
            val cur = power(x, p / 2)
            (cur * cur) % mod
        }
        else -> (power(x, p - 1) * x) % mod
    }

    var ans = 1L

    for (p in primes) {
        var curP = p.toLong()
        while (n / curP > 0) {
            ans = (ans * power(p.toLong(), n / curP)) % mod
            if ((curP * p) / p != curP) break
            curP *= p
        }
    }

    println(ans)
}

class Scanner(s: InputStream) {
    var st: StringTokenizer? = null
    val br: BufferedReader = BufferedReader(InputStreamReader(s))

    operator fun next(): String {
        while (st == null || !st!!.hasMoreTokens())
            st = StringTokenizer(br.readLine())
        return st!!.nextToken()
    }

    fun nextInt(): Int {
        return Integer.parseInt(next())
    }

    fun nextLong(): Long {
        return java.lang.Long.parseLong(next())
    }

    fun nextLine(): String {
        return br.readLine()
    }

    fun nextDouble(): Double {
        return java.lang.Double.parseDouble(next())
    }

    companion object {
        val sysIn = Scanner(System.`in`)
    }

}

val rnd = Random()
fun IntArray.sort() {
    val n = this.size
    for (i in 0 until n - 1) {
        val randomPos = i + rnd.nextInt(n - i - 1) + 1
        this[i] = this[i] xor this[randomPos]
        this[randomPos] = this[randomPos] xor this[i]
        this[i] = this[i] xor this[randomPos]
    }
    Arrays.sort(this)
}

fun LongArray.sort() {
    val n = this.size
    for (i in 0 until n - 1) {
        val randomPos = i + rnd.nextInt(n - i - 1) + 1
        this[i] = this[i] xor this[randomPos]
        this[randomPos] = this[randomPos] xor this[i]
        this[i] = this[i] xor this[randomPos]
    }
    Arrays.sort(this)
}

import java.io.BufferedReader
import java.io.InputStream
import java.io.InputStreamReader
import java.util.*
import kotlin.collections.ArrayList
import kotlin.math.sqrt

fun main() {
    val sc = Scanner.sysIn

    val x = sc.nextInt()
    val n = sc.nextLong()

    val primes = ArrayList<Int>()

    for (i in 2..sqrt(x.toDouble()).toInt() + 10) {
        if (x % i == 0) {
            var isPrime = true
            primes.forEach { if (i % it == 0) isPrime = false }
            if (isPrime)
                primes += i
        }
    }
    if (primes.isEmpty()) primes += x

    val mod = 1000000007
    fun power(x: Long, p: Long): Long = when {
        p == 0L -> 1
        p == 1L -> x % mod
        p % 2 == 0L -> {
            val cur = power(x, p / 2)
            (cur * cur) % mod
        }
        else -> (power(x, p - 1) * x) % mod
    }

    var ans = 1L

    for (p in primes) {
        //println(p)
        var num = 0L
        var curP = p.toLong()
        while (n / curP > 0) {
            println(curP)
            num += n / curP
            if (curP * p / p != curP) break
            curP *= p
        }
        ans = ans * power(p.toLong(), num) % 1000000007
    }

    println(ans)
}

class Scanner(s: InputStream) {
    var st: StringTokenizer? = null
    val br: BufferedReader = BufferedReader(InputStreamReader(s))

    operator fun next(): String {
        while (st == null || !st!!.hasMoreTokens())
            st = StringTokenizer(br.readLine())
        return st!!.nextToken()
    }

    fun nextInt(): Int {
        return Integer.parseInt(next())
    }

    fun nextLong(): Long {
        return java.lang.Long.parseLong(next())
    }

    fun nextLine(): String {
        return br.readLine()
    }

    fun nextDouble(): Double {
        return java.lang.Double.parseDouble(next())
    }

    companion object {
        val sysIn = Scanner(System.`in`)
    }

}

val rnd = Random()
fun IntArray.sort() {
    val n = this.size
    for (i in 0 until n - 1) {
        val randomPos = i + rnd.nextInt(n - i - 1) + 1
        this[i] = this[i] xor this[randomPos]
        this[randomPos] = this[randomPos] xor this[i]
        this[i] = this[i] xor this[randomPos]
    }
    Arrays.sort(this)
}

fun LongArray.sort() {
    val n = this.size
    for (i in 0 until n - 1) {
        val randomPos = i + rnd.nextInt(n - i - 1) + 1
        this[i] = this[i] xor this[randomPos]
        this[randomPos] = this[randomPos] xor this[i]
        this[i] = this[i] xor this[randomPos]
    }
    Arrays.sort(this)
}

import java.io.BufferedReader
import java.io.InputStream
import java.io.InputStreamReader
import java.util.*
import kotlin.collections.ArrayList
import kotlin.math.sqrt

fun main() {
    val sc = Scanner.sysIn

    val x = sc.nextInt()
    val n = sc.nextLong()

    val primes = ArrayList<Int>()

    fun isPrime(k: Int): Boolean {
        if (k == 1) return false
        if (k == 2 || k == 3) return true
        for (i in 2..sqrt(k.toDouble()).toInt() + 1) {
            if (k % i == 0) {
                return false
            }
        }
        return true

    }

    for (i in 2..sqrt(x.toDouble()).toInt() + 1) {
        if (x % i == 0) {
            if (isPrime(i))
                primes += i
            if (isPrime(x / i))
                primes += x / i
        }
    }
    //if (isPrime(x)) primes += x

    primes.forEach { println(it) }

    val mod = 1000000007
    fun power(x: Long, p: Long): Long = when {
        p == 0L -> 1
        p == 1L -> x % mod
        p % 2 == 0L -> {
            val cur = power(x, p / 2)
            (cur * cur) % mod
        }
        else -> (power(x, p - 1) * x) % mod
    }

    var ans = 1L

    for (p in primes) {
        var curP = p.toLong()
        while (n / curP > 0) {
            //println(curP)
            ans = (ans * power(p.toLong(), n / curP)) % mod
            if ((curP * p) / p != curP) break
            curP *= p
        }
    }

    println(ans)
}

class Scanner(s: InputStream) {
    var st: StringTokenizer? = null
    val br: BufferedReader = BufferedReader(InputStreamReader(s))

    operator fun next(): String {
        while (st == null || !st!!.hasMoreTokens())
            st = StringTokenizer(br.readLine())
        return st!!.nextToken()
    }

    fun nextInt(): Int {
        return Integer.parseInt(next())
    }

    fun nextLong(): Long {
        return java.lang.Long.parseLong(next())
    }

    fun nextLine(): String {
        return br.readLine()
    }

    fun nextDouble(): Double {
        return java.lang.Double.parseDouble(next())
    }

    companion object {
        val sysIn = Scanner(System.`in`)
    }

}

val rnd = Random()
fun IntArray.sort() {
    val n = this.size
    for (i in 0 until n - 1) {
        val randomPos = i + rnd.nextInt(n - i - 1) + 1
        this[i] = this[i] xor this[randomPos]
        this[randomPos] = this[randomPos] xor this[i]
        this[i] = this[i] xor this[randomPos]
    }
    Arrays.sort(this)
}

fun LongArray.sort() {
    val n = this.size
    for (i in 0 until n - 1) {
        val randomPos = i + rnd.nextInt(n - i - 1) + 1
        this[i] = this[i] xor this[randomPos]
        this[randomPos] = this[randomPos] xor this[i]
        this[i] = this[i] xor this[randomPos]
    }
    Arrays.sort(this)
}

import java.io.BufferedReader
import java.io.InputStream
import java.io.InputStreamReader
import java.util.*
import kotlin.collections.ArrayList
import kotlin.math.sqrt

fun main() {
    val sc = Scanner.sysIn

    val x = sc.nextInt()
    val n = sc.nextLong()

    val primes = ArrayList<Int>()

    fun isPrime(k: Int): Boolean {
        if (k == 1) return false
        if (k == 2 || k == 3) return true
        for (i in 2..sqrt(k.toDouble()).toInt() + 1) {
            if (k % i == 0) {
                return false
            }
        }
        return true

    }

    for (i in 2..sqrt(x.toDouble()).toInt() + 1) {
        if (x % i == 0) {
            if (isPrime(i))
                primes += i
            if (isPrime(x / i))
                primes += x / i
        }
    }
    if (isPrime(x)) primes += x

    //primes.forEach { println(it) }

    val mod = 1000000007
    fun power(x: Long, p: Long): Long = when {
        p == 0L -> 1
        p == 1L -> x % mod
        p % 2 == 0L -> {
            val cur = power(x, p / 2)
            (cur * cur) % mod
        }
        else -> (power(x, p - 1) * x) % mod
    }

    var ans = 1L

    for (p in primes) {
        var curP = p.toLong()
        while (n / curP > 0) {
            //println(curP)
            ans = (ans * power(p.toLong(), n / curP)) % mod
            if ((curP * p) / p != curP) break
            curP *= p
        }
    }

    println(ans)
}

class Scanner(s: InputStream) {
    var st: StringTokenizer? = null
    val br: BufferedReader = BufferedReader(InputStreamReader(s))

    operator fun next(): String {
        while (st == null || !st!!.hasMoreTokens())
            st = StringTokenizer(br.readLine())
        return st!!.nextToken()
    }

    fun nextInt(): Int {
        return Integer.parseInt(next())
    }

    fun nextLong(): Long {
        return java.lang.Long.parseLong(next())
    }

    fun nextLine(): String {
        return br.readLine()
    }

    fun nextDouble(): Double {
        return java.lang.Double.parseDouble(next())
    }

    companion object {
        val sysIn = Scanner(System.`in`)
    }

}

val rnd = Random()
fun IntArray.sort() {
    val n = this.size
    for (i in 0 until n - 1) {
        val randomPos = i + rnd.nextInt(n - i - 1) + 1
        this[i] = this[i] xor this[randomPos]
        this[randomPos] = this[randomPos] xor this[i]
        this[i] = this[i] xor this[randomPos]
    }
    Arrays.sort(this)
}

fun LongArray.sort() {
    val n = this.size
    for (i in 0 until n - 1) {
        val randomPos = i + rnd.nextInt(n - i - 1) + 1
        this[i] = this[i] xor this[randomPos]
        this[randomPos] = this[randomPos] xor this[i]
        this[i] = this[i] xor this[randomPos]
    }
    Arrays.sort(this)
}

import java.io.BufferedReader
import java.io.InputStream
import java.io.InputStreamReader
import java.util.*
import kotlin.collections.ArrayList
import kotlin.math.sqrt

fun main() {
    val sc = Scanner.sysIn

    val x = sc.nextInt()
    val n = sc.nextLong()

    val primes = ArrayList<Int>()

    for (i in 2..sqrt(x.toDouble()).toInt() + 10) {
        if (x % i == 0) {
            var isPrime = true
            primes.forEach { if (i % it == 0) isPrime = false }
            if (isPrime)
                primes += i
        }
    }
    if (primes.isEmpty()) primes += x

    val mod = 1000000007
    fun power(x: Long, p: Long): Long = when {
        p == 0L -> 1
        p == 1L -> x % mod
        p % 2 == 0L -> {
            val cur = power(x, p / 2)
            (cur * cur) % mod
        }
        else -> (power(x, p - 1) * x) % mod
    }

    var ans = 1L

    for (p in primes) {
        //println(p)
        var curP = p.toLong()
        while (n / curP > 0) {
            //println(curP)
            ans = ans * power(p.toLong(), n / curP) % 1000000007
            if (curP * p / p != curP) break
            curP *= p
        }
    }

    println(ans)
}

class Scanner(s: InputStream) {
    var st: StringTokenizer? = null
    val br: BufferedReader = BufferedReader(InputStreamReader(s))

    operator fun next(): String {
        while (st == null || !st!!.hasMoreTokens())
            st = StringTokenizer(br.readLine())
        return st!!.nextToken()
    }

    fun nextInt(): Int {
        return Integer.parseInt(next())
    }

    fun nextLong(): Long {
        return java.lang.Long.parseLong(next())
    }

    fun nextLine(): String {
        return br.readLine()
    }

    fun nextDouble(): Double {
        return java.lang.Double.parseDouble(next())
    }

    companion object {
        val sysIn = Scanner(System.`in`)
    }

}

val rnd = Random()
fun IntArray.sort() {
    val n = this.size
    for (i in 0 until n - 1) {
        val randomPos = i + rnd.nextInt(n - i - 1) + 1
        this[i] = this[i] xor this[randomPos]
        this[randomPos] = this[randomPos] xor this[i]
        this[i] = this[i] xor this[randomPos]
    }
    Arrays.sort(this)
}

fun LongArray.sort() {
    val n = this.size
    for (i in 0 until n - 1) {
        val randomPos = i + rnd.nextInt(n - i - 1) + 1
        this[i] = this[i] xor this[randomPos]
        this[randomPos] = this[randomPos] xor this[i]
        this[i] = this[i] xor this[randomPos]
    }
    Arrays.sort(this)
}


fun main()
{
    val lens = readLine()!!.toInt()
    val given = readLine()!!
    var c = 'A'
    var answer = "YES"
    while (c <= 'Z')
    {
        if (given.contains(c))
        {
            ++c
            continue
        }
        else if (given.contains(c.toLowerCase()))
        {
            ++c
            continue
        }
        else
        {
            answer = "NO"
            break
        }
    }
    println(answer)
}

import java.util.*

fun main(args: Array<String>) {
    val alphabet = ('a'..'z').toList().toCharArray()

    val sc = Scanner(System.`in`)
    sc.nextLine()
    val line = sc.nextLine()

    println(if(pangram(line, alphabet)) "YES" else "NO")
}

fun pangram(line: String, alphabet: CharArray): Boolean {
    if (line.length < alphabet.size) {
        return false
    }

    val lowercase = line.toLowerCase()
    return alphabet.filter { it !in lowercase }.isEmpty()
}

import java.io.BufferedReader
import java.io.InputStreamReader

fun main() {
    val br = BufferedReader(InputStreamReader(System.`in`))
    val n = br.readLine().toInt()
    val s = br.readLine().toLowerCase()
    println(
        if (s.toSet().size == 26) "YES" else "NO"
    )
}

fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    if(n < 26) {
        println("NO")
    } else {
        val word = readLine()!!.toLowerCase().toSortedSet()
        if(word.size >= 26) println("YES")
        else println("NO")
    }
}

fun main(args: Array<String>) {
    val length = Integer.parseInt(readLine().toString())
    val sentence = readLine().toString().toLowerCase()
    if(isPangram(length,sentence)){
        println("YES")
    }
    else{
        println("NO")
    }
}
fun isPangram(inter:Int,input:String):Boolean {
        for (a in 'a'..'z'){
            val isChar: (Char) -> Boolean = {it == a}
            if(!input.any(predicate = isChar )) {
                return false }
            }
        return true
    }

fun main(args: Array<String>) {
    readLine()
    val s = readLine()!!.toLowerCase()
    println(if (('a'..'z').all { s.contains(it) }) "YES" else "NO")
}

import java.util.*

fun main(){

    val scan = Scanner(System.`in`)

    val n = scan.nextInt()
    val arr = Array<Boolean>(26){ _ -> false}
    var c = 0
    val line = scan.next().toUpperCase()

    if (n<26){
        print("NO")
        return
    }
    for (i in line){
        val tmp = i.toInt()
        arr[tmp-65] = true
    }

    for (i in arr) if (i) c++

    if (c == 26) print("YES")
    else print("NO")
}

fun main() {
    readLine()!!
    if (readLine()!!.asSequence().map { it.toLowerCase() }.toSet().size == 26)
        println("YES")
    else
        println("NO")
}

import java.lang.AssertionError
import java.util.*

private fun readLn() = readLine()!! // string line
private fun readInt() = readLn().toInt() // single int
private fun readLong() = readLn().toLong() // single long
private fun readDouble() = readLn().toDouble() // single double
private fun readStrings() = readLn().split(" ") // list of strings
private fun readInts() = readStrings().map { it.toInt() } // list of ints
private fun readLongs() = readStrings().map { it.toLong() } // list of longs
private fun readDoubles() = readStrings().map { it.toDouble() } // list of doubles

private fun myAssert(x: Boolean) {
    if (!x) {
        throw AssertionError()
    }
}

fun main(args: Array<String>) {
//  var s = Scanner(System.`in`)
  var n = readInt()
  var s = readLn().toLowerCase()
  var ss = mutableSetOf<Char>()
  for (i in 0..n - 1) {
    ss.add(s[i])
  }
  if (ss.size < 26) {
    println("NO")
  } else {
    println("YES")
  }
}

import java.util.*
import kotlin.collections.HashMap

//author:Ismail moussi
fun main()
{
    val scan=Scanner(System.`in`)
    val n:Int=scan.nextInt()
    var s:String=scan.next()
    var map=HashMap<Char,Int>()
    if(s.length<26)
        print("NO")
    else {

       var ss= s.toUpperCase()
        for (i in 0 until s.length) {
            map.put(ss.get(i), 0)
        }
//     if(map.size<26)
//         println("NO")else println("YES")
        when(map.size)
        {
          in 1..25-> print("NO")
            else -> print("YES")
        }
    }
}

fun main() {
    readLine()
    val s = readLine()!!
    val chars = mutableSetOf<Char>()
    for (c in s) chars.add(c.toLowerCase())
    print(if (chars.size == 26) "YES" else "NO")
}

import java.util.*
import kotlin.collections.ArrayList
import kotlin.math.*
import kotlin.system.measureTimeMillis

fun getMinimumAmountOfChangeFrom(amount: Int): Int {
    val changes = listOf(10, 5, 1)
    var availableAmount = amount
    var numOfCoins = 0
    for (change in changes) {
        while (availableAmount > 0 && availableAmount / change.toDouble() >= 1) {
            numOfCoins += 1
            availableAmount -= change
        }
    }
    return numOfCoins
}

fun getMaximumValueOfTheLootWith(
    W: Int,
    valuePerUnitAndWeight: List<Pair<Double, Int>>
): Double {
    var maximumLootValue = 0.0
    var availableWeight = W
    for (pair in valuePerUnitAndWeight) {
        var availableWeightOfLootItem = pair.second
        while (availableWeight > 0 && availableWeightOfLootItem > 0) {
            maximumLootValue += pair.first
            availableWeightOfLootItem -= 1
            availableWeight -= 1
        }
    }
    return maximumLootValue
}

fun getMinimumNumOfRefills(d: Int, m: Int, stops: List<Int>): Int {
    var availableDistance = d
    var minimumRefills = 0
    var currentRefill = 0
    var lastRefill = 0
    val realStops = listOf<Int>(0, *stops.toTypedArray(), d)
    while (availableDistance > 0 && currentRefill < realStops.size) {
        var movedForward = false
        while (currentRefill < realStops.size && (realStops[currentRefill] - realStops[lastRefill]) <= m) {
            if (realStops[currentRefill] - realStops[lastRefill] == 0) {
                movedForward = false
                currentRefill++
            } else {
                movedForward = true
                currentRefill++
            }
        }
        if (movedForward) {
            minimumRefills++
            currentRefill--
            availableDistance -= (realStops[currentRefill] - realStops[lastRefill])
            lastRefill = currentRefill
        } else {
            return -1
        }
    }
    return minimumRefills - 1
}

fun getMaximizedSumOfProduct(profitPerClick: List<Int>, averageNumberOfClicks: List<Int>): Long {
    var sum = 0L
    println(profitPerClick.toString())
    println(averageNumberOfClicks.toString())
    profitPerClick.forEachIndexed { index, profit ->
        sum += profit * averageNumberOfClicks[index]
    }
    return sum
}

fun getCommon(first: Int, last: Int, segments: MutableList<Pair<Int, Int>>): String {
    var current = first
    val common = mutableListOf<Pair<Int, Int>>()
    while (current <= last) {
        var numOfTimes = 0
        for (pair in segments) {
            if (current in pair.first..pair.second) {
                numOfTimes++
            }
        }
        if (numOfTimes > 1) {
            common.add(Pair(current, numOfTimes))
        }
        current++
    }
    common.sortByDescending { it -> it.second }
    if (common.first().second == segments.size) {
        return "1\n${common.first().first}"
    }
    println(common)
    return "${common.size}\n${common.map { it.first }.joinToString(" ")}"
}

fun getMaximumSetOfPrizes(n: Int): String {
    var numbersOfN = ""
    var sumSoFar = 0
    if (n <= 2) {
        return "1\n$n"
    }
//    println("2*square root of n = ${2 * sqrt(n.toDouble())}")
//    for (i in 1..(2 * sqrt(n.toDouble()).toInt())){
//        if (i+sumSoFar<=n){
//            numbersOfN+="$i "
//            sumSoFar+=i
//        }
//    }
//    var lastNumber = 1
    var currentNumber = 1
    while (((currentNumber + 1) + currentNumber) <= n - sumSoFar) {
        sumSoFar += currentNumber
        numbersOfN += "$currentNumber "
        currentNumber++
    }
    if (((n - currentNumber) + sumSoFar) == n || n - sumSoFar > 0) {
        currentNumber = n - sumSoFar
        sumSoFar += currentNumber
        numbersOfN += "$currentNumber "
    }
//    else if (n-sumSoFar>0){
//        currentNumber = n-sumSoFar
//        numbersOfN += "$currentNumber "
//    }
    return "${numbersOfN.trim().split(" ").size}\n$numbersOfN"
}

fun linelandMail(coordinates: List<Long>): String {
    val mins = mutableListOf<Long>()
    val maxs = mutableListOf<Long>()
    for (i in coordinates.indices) {
        if (i == 0) {
            mins.add(abs(coordinates[i] - coordinates[i + 1]))
            maxs.add(abs(coordinates[i] - coordinates[coordinates.size - 1]))
        } else if (i == coordinates.size - 1) {
            mins.add(abs(coordinates[i] - coordinates[i - 1]))
            maxs.add(abs(coordinates[i] - coordinates[0]))
        } else {
            if (abs(coordinates[i] - coordinates[i - 1])
                > abs(coordinates[i] - coordinates[i + 1])
            )
                mins.add(abs(coordinates[i] - coordinates[i + 1]))
            else
                mins.add(abs(coordinates[i] - coordinates[i - 1]))

            if (abs(coordinates[i] - coordinates[0])
                < abs(coordinates[i] - coordinates[coordinates.size - 1])
            )
                maxs.add(abs(coordinates[i] - coordinates[coordinates.size - 1]))
            else
                maxs.add(abs(coordinates[i] - coordinates[0]))
        }
    }
    return mins
        .zip(maxs)
        .map { pair -> "${pair.first} ${pair.second}" }
        .joinToString("\n")
}

fun snacktower(snacksWeights: List<Int>) {
    val n = snacksWeights.size
    var currentMax = n
    var current = 0
    var processed = mutableListOf<Int>()
    while (current < snacksWeights.size) {
        if (snacksWeights[current] < currentMax) {
            processed.add(snacksWeights[current])
            print("\n")
            current++
        } else {
            if (snacksWeights[current] == currentMax) {
                print(currentMax)
                currentMax--
                var currentProcessed = 0
                while (currentProcessed < processed.size) {
                    var foundConsecutive = false
                    if (processed[currentProcessed] == currentMax) {
                        print(" ")
                        print(processed[currentProcessed])
                        currentMax--
                        foundConsecutive = true
                        processed = processed.swap(currentProcessed, processed.size - 1).toMutableList()
                        processed.removeAt(processed.size - 1)
                    }
                    if (!foundConsecutive) {
                        currentProcessed++
                    } else {
                        currentProcessed = 0
                    }
                }
                println()
                current++
            }
        }
    }
}

fun <T> List<T>.swap(a: Int, b: Int): List<T> = this
    .toMutableList()
    .also {
        it[a] = this[b]
        it[b] = this[a]
    }

fun `Oath of the Night's Watch`(stewardsStrengths: List<Int>) {
    val sortedStrengths = stewardsStrengths.sorted()
    var numberOfThoseWhoNeedSupport = 0
    for (strengthIndex in sortedStrengths.indices) {
        val precedingSteward = strengthIndex - 1
        val nextSteward = strengthIndex + 1
        if (precedingSteward>=0 && nextSteward<sortedStrengths.size){
            if (sortedStrengths[precedingSteward]<sortedStrengths[strengthIndex]
                && sortedStrengths[nextSteward]>sortedStrengths[strengthIndex]){
                numberOfThoseWhoNeedSupport++
            }
        }
    }
    println(numberOfThoseWhoNeedSupport)
}

fun pangram(characters: String){
    print(if (characters.toLowerCase().toSet().size==26) "YES" else "NO")
}

fun main() {

//    val scanner = Scanner(System.`in`)
//    val n = scanner.nextInt()
//    val snacksWeights = MutableList<Int>(n) { index -> 0 }
//    for (i in 0 until n) {
//        snacksWeights[i] = scanner.nextInt()
//    }
//    snacktower(snacksWeights)
//    val scanner = Scanner(System.`in`)
//    val n = scanner.nextInt()
//    val strengths = MutableList<Int>(n) { index -> 0 }
//    for (i in 0 until n) {
//        strengths[i] = scanner.nextInt()
//    }
//    `Oath of the Night's Watch`(strengths)
    val n = readLine()!!.toInt()
    val characters = readLine()!!
    pangram(characters)
}

// start of stress test
//    while (true) {
//        val n = Random.nextLong(1000000)
//        val m = Random.nextLong(100000)
//        if (m<n){
//            val res1 = getFibonacciPartialSumNaive(m,n)
//            val res2 = getLastDigitOfSumOfSubsetOfFibs(m,n)
//            if (res1.toInt() == res2) {
//                println("Ok")
//            } else {
//                println("Wrong Answer at n = $n and m = $m")
//                print("$res1 $res2")
//                break
//            }
//        }
//
//    }

fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    val s = readLine()!!
    val arr = Array<Int>(26, {i -> 0})
    for (c in s) {
        if ('a' <= c && c <= 'z') {
            arr[c-'a'] = 1
        } else if ('A' <= c && c <= 'Z') {
            arr[c-'A'] = 1
        }
    }
    if (arr.all{it == 1})
        print("YES\n")
    else
        print("NO\n")
}

fun main(args: Array<String>) {
    readLine()
    println(if (readLine()!!.toLowerCase().toSet().size >= 26) "YES" else "NO")
}

private fun readLn() = readLine()!! // string line
private fun readInt() = readLn().toInt() // single int
private fun readLong() = readLn().toLong() // single long
private fun readDouble() = readLn().toDouble() // single double
private fun readStrings() = readLn().split(" ") // list of strings
private fun readInts() = readStrings().map { it.toInt() } // list of ints
private fun readLongs() = readStrings().map { it.toLong() } // list of longs
private fun readDoubles() = readStrings().map { it.toDouble() } // list of doubles

val charRange = 'a'..'z'

fun main() {
    readLn()
    val sentence = readLn()

    if(sentence.map { it.toLowerCase() }.containsAll(charRange.toList())) println("YES") else println("NO")
}

fun main(args: Array<String>) {
    readLine() !!
    val count = readLine()!!.toLowerCase().toSet().size
    println(if (count == 26) "YES" else "NO")
}

import java.util.*

fun min(a:Double,b:Double) = if (a<b) a else b
fun max(a:Double,b:Double) = if (a>b) a else b
fun min(a:Long,b:Long) = if (a<b) a else b
fun max(a:Long,b:Long) = if (a>b) a else b

fun readLn():String = readLine()!!.toString()
fun readLong() = readLn().toLong()
fun readLongs()  = readLn().split(" ").map{it.toLong()}
var nul=0.toLong();
var one=1.toLong();
var two=2.toLong();
var three=3.toLong();
var four=4.toLong();
var five=5.toLong();
fun powmod(a:Long,b:Long,mod:Long):Long {

    if (b==1.toLong()) return a;
    var k=powmod(a,b/2,mod);
    if (b%2==0.toLong())
    { return (k*k)%mod }
    else { k=k*k; k=k%mod; k=k*a; k=k%mod; return k; }
}
fun prime (p:Long):Long {
    if (p==one) return 0.toLong();
    var i=two;
    while (i*i<=p) {if (p%i==nul) return i; i++; }
    return one;
}
fun inv (a:Long,mod:Long):Long {
return powmod(a,mod-2,mod);
}

fun solve() {
    val cin = Scanner(System.`in`)

    /*
    var map=hashMapOf<String,Int>();
    map[q] <=> map.getOrDefault(q,0)
    Сортировка вектора пар - k=v.sortedWith(compareBy({it.first},{it.second}));
    prLong("${k[i].second}"); - вывод аргумента пары
    var m=ArrayList<Long> (); <=> vector
    getline(cin,a) <=> readLine()!!.last()
   readLong() - одно число
   readLongs() - несколько чисел
   readLine()!!.toCharArray() - возвращает массив чаров из строки

    */
    /* --------- */
        // ВСЕГДА ПИСАТЬ В ЛОНГАХ
    var a=readLong();
    var s=readLine()!!;

    var mem=mutableSetOf<Char>();
    for (c in s) {var pog=c; if (c>='A' && c<='Z') { var code=pog.toInt(); code-='A'.toInt(); code+='a'.toInt(); pog=code.toChar(); }
        mem.add(pog); }
    if (mem.size>=26) print("YES"); else print("NO");

    /* --------- */

}

fun main() {
    val cin = Scanner(System.`in`)

    var T=one;
    //T=readLine()!!.toLong();
    for (i55555 in 1..T) solve()
}

fun main(args: Array<String>) {

    var n = readLine()!!.toInt()
    var str = readLine()!!.toLowerCase()
    var ok = 0
    for(i in 'a'..'z')if(str.contains(i)) ok++
    if(ok == 26)print("YES")
    else print("NO")
}

fun readLn() = readLine()!!
fun readInt() = readLn().toInt()
fun readDouble() = readLn().toDouble()
fun readLong() = readLn().toLong()
fun readStrings() = readLn().split(' ')
fun readInts() = readStrings().map { it.toInt() }
fun readDoubles() = readStrings().map { it.toDouble() }
fun readLongs() = readStrings().map { it.toLong() }

fun main(args: Array<String>) {
    val n = readInt()
    val s = readLn()

    for (ch in 'a'..'z') {
        if (!s.contains(ch) && !s.contains(ch.toUpperCase())) {
            println("NO")
            return
        }
    }

    println("YES")
}

import java.io.*
import java.util.*

class ProblemIO(val rd: BufferedReader, val wr: PrintWriter) {
    var tok = StringTokenizer("")

    companion object {
        fun console() = ProblemIO(BufferedReader(InputStreamReader(System.`in`)), PrintWriter(System.out))
        fun files(inputFilename: String, outputFilename: String) =
                ProblemIO(BufferedReader(FileReader(File(inputFilename))), PrintWriter(File(outputFilename)))
    }

    fun readToken(): String {
        while (!tok.hasMoreTokens()) {
            tok = StringTokenizer(rd.readLine())
        }
        return tok.nextToken()
    }

    fun readInt(): Int = readToken().toInt()
    fun <T> print(v: T) = wr.print(v)
    fun <T> println(v: T) = wr.println(v)
    fun close() {
        rd.close()
        wr.close()
    }
}

fun solve() {
    val io = ProblemIO.console()
    val n = io.readInt()
    val t = io.readToken()
    val res = (t.toLowerCase().toSet().size == 26)
    io.println(if (res) "YES" else "NO  ")
    io.close()
}

fun main(args: Array<String>) {
    Thread({ solve() }).start()
}

fun main() {
    val r = System.`in`.bufferedReader()
    val s = StringBuilder()
    val n = r.readLine()!!
    val diff = r.readLine()!!.toLowerCase().split("").groupBy { it }.size
    println(if (diff==27) "YES" else "NO")
}

fun main(args: Array<String>) {
    var n =  readLine()!!.toInt()
    var s = readLine()!!
    var c = 0
    s = s.toUpperCase()
    for (i in 'A'..'Z'){
        if (s.contains(i)){
            c++
        }
    }
    if (c >= 26){
        print("YES")
    }
    else
        print("NO")
}

import java.util.*

fun main(args: Array<String>) {

    val scanner = Scanner(System.`in`)
    val q = scanner.nextInt()
    var line = scanner.next().toLowerCase()

    var set = mutableSetOf<Char>()

    (0 until q).forEach { set.add(line[it]) }

    if (set.size == 26) println("YES")
    else println("NO")

}

import java.util.Scanner;
import java.util.Arrays;
import java.util.*;
import java.math.*;
import java.io.*;

fun main(args: Array<String>) {
var s = Scanner(System.`in`)
var numberofletters = s.nextInt()
var sentence = s.next()
var res = sentence.toLowerCase();
var charSentence = res.toCharArray()
Arrays.sort(charSentence)
var pangram = 0
var start = 97
for(i in 0 until numberofletters){
val charSentenceAsInt = charSentence[i].toInt()
if(charSentenceAsInt==start){
pangram++
start++
}
}
if(pangram == 26){
print("YES")
}else{
print("NO")
}

}

import java.util.*
import kotlin.math.max

fun main() {
    val scan = Scanner(System.`in`)
    val size = scan.nextInt()
    val list:Iterable<Char> = scan.next().asIterable()
    pangram(list)
}

//  http://codeforces.com/contest/520/problem/A
fun pangram(list: Iterable<Char>) {
    val set = mutableSetOf<Char>()
    for (c in list) {
        set.add(c.toLowerCase())
    }
    val result = if (set.size == 26) "YES" else "NO"
    println(result)
}

import java.io.*
import java.util.*

fun main(args: Array<String>) {
    val inputStream = System.`in`
    val outputStream = System.out
    val input = InputReader(inputStream)
    val output = PrintWriter(outputStream)
    val solver = Task()
    solver.solve(input, output)
    output.close()
}

private class Task {
    fun solve(input: InputReader, output: PrintWriter) {
        input.nextInt()

        ('a'..'z').toSet().let { set ->
            val s = input.next().toLowerCase()
            output.println(if (set.all { s.contains(it) }) "YES" else "NO")
        }
    }
}

private class InputReader(stream: InputStream) {
    private var reader: BufferedReader = BufferedReader(InputStreamReader(stream), 32768)
    private var tokenizer: StringTokenizer? = null

    operator fun next(): String {
        while (tokenizer == null || tokenizer?.hasMoreTokens()?.not() == true) {
            try {
                tokenizer = StringTokenizer(reader.readLine())
            } catch (e: IOException) {
                throw RuntimeException(e)
            }

        }
        return tokenizer!!.nextToken()
    }

    fun nextInt(): Int {
        return next().toInt()
    }

}

fun main(){
    readLine()
    var set = readLine()!!.toString().toLowerCase().toCharArray().toSet()
    println( if(set.size == 26) "YES\n" else "NO")
}

fun main(args: Array<String>) {
    val n = readInt()
    val s = readLine()!!.toLowerCase().toCharArray().toSet().size
    println(if (s == 26) "YES" else "NO")
}

private fun readInt() = readLine()!!.toInt()

import java.util.*
fun main(args: Array<String>) {
    var sc = Scanner(System.`in`)
    val n = sc.nextInt()
    val s = sc.next().toLowerCase()
    if (n < 26) println("NO")
    else {
        var count = IntArray(26)
        for ( i in 0 .. n-1){
            count[s[i].toInt()- 'a'.toInt()]++
        }
        var test = true
        for (i in 0 .. 25){
            if (count[i] == 0 ){
                test= false
                break
            }
        }
        println(if (test) "YES" else "NO")
    }
}

 fun main(args: Array<String>) {
      readLine()
    var s=readLine()!!.toLowerCase().toSet()
        if(s.size==26)
        print("YES")
        else
        print("NO")

    }

 fun main(args: Array<String>) {

    var s=readLine()!!.toLowerCase().toSet()
        if(s.size==26)
        print("YES")
        else
        print("NO")

    }

import java.util.*
import kotlin.collections.ArrayList
import kotlin.collections.HashMap
//author:Ismail moussi
fun main()
{
    val scan=Scanner(System.`in`)
    val n:Int=scan.nextInt()
    var s:String=scan.next()
    var map=HashMap<Char,Int>()
    if(s.length<26)
    {
        print("NO")
        return
    }
    else
    {
        s.toLowerCase()
        for(i in 0 until s.length)
        {
            map.put(s.get(i),0)
        }
    }
    if(map.size<26)
        print("NO")else
        print("YES")
}

import java.util.*
import kotlin.collections.ArrayList
import kotlin.collections.HashMap
//author:Ismail moussi
fun main()
{
    val scan=Scanner(System.`in`)
    val n:Int=scan.nextInt()
    var s:String=scan.next()
    var map=HashMap<Char,Int>()
    if(s.length<26)
    {
        print("NO")
        return
    }
    else
    {
        s.toLowerCase()
        for(i in 0 until s.length)
        {
            map.put(s.get(i),0)
        }
    }
    if(map.size==26)
        print("YES")else
        print("NO")
}

import java.util.*
import kotlin.collections.ArrayList
import kotlin.collections.HashMap
//author:Ismail moussi
fun main()
{
    val scan=Scanner(System.`in`)
    val n:Int=scan.nextInt()
    var s:String=scan.next()
    var map=HashMap<Char,Int>()
    if(s.length<26)
        print("NO")
    else {
        s.toLowerCase()
        for (i in 0 until s.length) {
            map.put(s.get(i), 0)
        }

        when(map.size)
        {
          in 0..25-> print("NO")
            else -> print("YES")
        }

//        if (map.size == 26)
//            print("YES") else
//            print("NO")
    }
}


import java.util.*

fun main(args: Array<String>) {
    var(l, r) = readLine()!!.split(" ").map(String::toInt)
    if (l == r) {
        println(l)
    } else {
        println(2)
    }
}

fun main() {
    val r = System.`in`.bufferedReader()
    val s = StringBuilder()
    //val n = r.readLine()!!
    val (n, m) = r.readLine()!!.split(" ").map { it.toInt() }
    if (n==m) println(n)
    else println(2)
}

import java.util.*

/**
 * Created by Igor on 7/17/2017.
 */

fun main(args: Array<String>) {
    val scanner = Scanner(System.`in`)
    val l = scanner.nextInt()
    val r = scanner.nextInt()

    if (l == r)
        println(l)
    else
        println(2)
}

import java.util.*

fun main(args: Array<String>){
    var sc = Scanner(System.`in`)
    var l = sc.nextInt()
    var r = sc.nextInt()
    println(if(l == r) l else 2)
}

fun main(args: Array<String>) {
	val (l,r) = readLine()!!.split(' ').map(String::toInt)
	val res = if ( r==l) l else 2;
	println(res)

}

import java.util.*

fun main(args: Array<String>) {
    val reader = Scanner(System.`in`)
    val left = reader.nextInt()
    val right = reader.nextInt()
    if (left == right && right % 3 == 0) println(3)
    else if (left == right && right % 2 != 0) println(right)
    else println(2)

}

import kotlin.math.abs

fun main() {
    var (l, r) = readLine()!!.split(' ').map { it.toInt() }
    if (abs(l-r)==0){
        println(l)
    }else{
        println(2)
    }
}

fun main() {
    fun readInts() = readLine()!!.split(" ").map(String::toInt)

    val (l, r) = readInts()
    print(if (l == r) l else 2)
}

//fun main() {
//    fun readLongs() = readLine()!!.split(" ").map(String::toLong)
//
//    val (l, r) = readLongs()
//    val divisorToTimes = mutableMapOf<Long, Int>()
//    val composites = mutableSetOf<Long>()
//    for (candidate in 2L..r) {
//        if (candidate in composites) continue
//        divisorToTimes[candidate] = if (candidate in l..r) 1 else 0
//        for (number in candidate + candidate..r step candidate) {
//            if (number in l..r)
//                divisorToTimes[candidate] = divisorToTimes[candidate]!! + 1
//            composites.add(number)
//        }
//    }
//    print(divisorToTimes.maxBy { it.value }!!.key)
//}

import java.io.BufferedReader
import java.io.InputStreamReader
import java.util.*

fun main(args: Array<String>) {
    val tokenizer = BufferedReader(InputStreamReader(System.`in`)).use { StringTokenizer(it.readText()) }
    val l = tokenizer.nextInt()
    val r = tokenizer.nextInt()
    if (l == r)
        println(l)
    else
        println(2)
}

fun StringTokenizer.nextInt() = Integer.parseInt(nextToken())

fun main(args: Array<String>) {
    val (l, r) = readLine()!!.split(' ').map(String::toInt)
    if (l == r)
        print("$l\n")
    else
        print("2\n")
}

fun main(args : Array<String>)
{
    var line: String = inputNotNull()
    var l: Long = line.split(" ")[0].toLong()
    var r: Long = line.split(" ")[1].toLong()
    var arr: Array<Long> = Array<Long>(Math.sqrt(r.toDouble()).toInt(),{i -> 0})

    if(r == 2L||r==4L){
        println(2)
        return
    }else if(r==3L){
        println(3)
        return
    }else if(l==r){
        println(l)
        return
    }

    println(2)

}

fun inputNotNull(): String
{
    val line: String? = readLine()
    if (line == null) return ""
    return line.trim()
}

fun main() {
    val r = System.`in`.bufferedReader()
    val s = StringBuilder()
    val n = r.readLine()!!
    //val (n, m) = r.readLine()!!.split(" ").map { it.toInt() }
    println(2)
}

import java.util.*

fun main(args: Array<String>) {
    val reader = Scanner(System.`in`)
    val left = reader.nextInt()
    val right = reader.nextInt()
    if (left == right && right % 3 == 0) println(3)
    else println(2)

}

import java.util.*

fun main(args: Array<String>) {
    var(l, r) = readLine()!!.split(" ").map(String::toInt)
    println(2)
}


fun main(args: Array<String>) {
    var count = readLine()!!.toInt()
    println(readLine()!!.split(" ").map { it.toInt() }.sorted()
        .map {
        it.toString()
    }.joinToString (" "))
}

fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    readLine()!!.split(" ").map { it.toInt() }.sorted().forEach({ print("${it} ") })
}

import java.io.*
import java.util.*

class ProblemIO(val rd: BufferedReader, val wr: PrintWriter) {
    var tok = StringTokenizer("")

    companion object {
        fun console() = ProblemIO(BufferedReader(InputStreamReader(System.`in`)), PrintWriter(System.out))
        fun files(inputFilename: String, outputFilename: String) =
                ProblemIO(BufferedReader(FileReader(File(inputFilename))), PrintWriter(File(outputFilename)))
    }

    fun readToken(): String {
        while (!tok.hasMoreTokens()) {
            tok = StringTokenizer(rd.readLine())
        }
        return tok.nextToken()
    }

    fun readInt(): Int = readToken().toInt()
    fun <T> print(v: T) = wr.print(v)
    fun <T> println(v: T) = wr.println(v)
    fun close() {
        rd.close()
        wr.close()
    }
}

fun solve() {
    val io = ProblemIO.console()
    val n = io.readInt()
    val a = IntArray(n)
    for (i in a.indices) {
        a[i] = io.readInt()
    }
    a.sort()
    io.println(a.joinToString(" "))
    io.close()
}

fun main(args: Array<String>) {
    Thread({ solve() }).start()
}

fun main()
{
    val ignore = readLine()!!.toInt()
    println(readLine()!!.split(" ").map { it.toInt() }.sorted().joinToString(" "))

}

fun main() {
    val r = System.`in`.bufferedReader()
    val s = StringBuilder()
    val n = r.readLine()!!.toInt()
    val l = r.readLine()!!.split(" ").map { it.toInt() }.sorted()
    println(l.joinToString(" "))
}

fun main() {
    readLine()!!
    val cubes = readLine()!!.split(" ").map(String::toInt)
    println(cubes.sorted().joinToString(separator = " ").trim())
}

import java.util.*

fun main(args: Array<String>) {
    val scanner = Scanner(System.`in`)
    val n = scanner.nextInt()

    var max = 0
    val columns = Array(n, {
        val curr = scanner.nextInt()
        if (curr > max) {
            max = curr
        }
        curr
    })

    val tmp = IntArray(max, { 0 })

    columns.forEach {
        tmp[it - 1]++
    }

    var index = 0
    tmp.forEachIndexed { i, v ->
        for (j in 0 until v) {
            columns[index++] = i + 1
        }
    }

    println(columns.joinToString(" "))

}

fun main() {
    readLine()
    readLine()!!.split(' ').map(String::toInt).sorted().forEach { print("$it ") }
}

import java.io.BufferedReader
import java.io.InputStreamReader
import java.lang.StringBuilder

fun main(args: Array<String>) {
    val br = BufferedReader(InputStreamReader(System.`in`))
    br.readLine()
    val row = br.readLine().split("\\s+".toRegex())
    val sortedRow = row.sortedBy { i -> i.toInt() }
    val sb = StringBuilder()
    for (i in sortedRow)
        sb.append("$i ")
    sb.deleteCharAt(sb.length - 1)
    print(sb.toString())
}

import java.io.*
import java.util.*

fun main(args: Array<String>) {
    val inputStream = System.`in`
    val outputStream = System.out
    val input = InputReader(inputStream)
    val output = PrintWriter(outputStream)
    val solver = Task()
    solver.solve(input, output)
    output.close()
}

private class Task {
    fun solve(input: InputReader, output: PrintWriter) {
        val n = input.nextInt()

        val heights = (1..n).map { input.nextInt() }
        val maxHeight: Int = heights.max()!!

        val box = Array(maxHeight, { IntArray(n, { 0 }) })
        for (i in 0 until n) {
            for (j in 0 until heights[i]) {
                box[maxHeight - j - 1][i] = 1
            }
        }

        for (i in 0 until maxHeight) {
            for (j in n - 2 downTo 0) {
                for (k in j until n - 1) {
                    if (box[i][k] == 1) {
                        if (box[i][k + 1] == 0) {
                            box[i][k + 1] = 1
                            box[i][k] = 0
                        }
                    } else {
                        break
                    }
                }
            }
        }

        for (j in 0 until n) {
            var sum = 0
            for (i in 0 until maxHeight) {
                sum += box[i][j]
            }
            output.print(sum)
            output.print(" ")
        }
    }
}

private class InputReader(stream: InputStream) {
    private var reader: BufferedReader = BufferedReader(InputStreamReader(stream), 32768)
    private var tokenizer: StringTokenizer? = null

    operator fun next(): String {
        while (tokenizer == null || tokenizer?.hasMoreTokens()?.not() == true) {
            try {
                tokenizer = StringTokenizer(reader.readLine())
            } catch (e: IOException) {
                throw RuntimeException(e)
            }

        }
        return tokenizer!!.nextToken()
    }

    fun nextInt(): Int {
        return next().toInt()
    }

}

fun main() {
    readLine()
    println(readLine()!!.split(" ").map(String::toInt).sorted().joinToString(" "))
}

fun main() {
    readLine()
    val input = readLine()!!.split(" ").map(String::toInt).sorted()
    println(input.joinToString(" "))
}

import java.io.PrintWriter
import kotlin.math.*

fun main() {
    io.apply {

        cout .. ints().sorted().toIntArray() .. nl

    }.cout.flush()
}

// @formatter:off
private val io = object {
    private val `in` = System.`in`
    private fun ll(): Long {
        var x: Int; var q = false; var n = 0L; do x = `in`.read() while (x < 33); if (x == 45) { q = true; x = `in`.read() }
        do { n = n * 10 - x + 48; x = `in`.read() } while (x > 32); return if (q) n else -n
    }
    val int get() = ll().toInt(); val long get() = ll()
    fun ints(n: Int = int): IntArray { return IntArray(n) { int } }
    fun ints1(n: Int = int): IntArray { return IntArray(n) { int - 1 } }
    val cout = PrintWriter(System.out); val nl = "\n"
    operator fun PrintWriter.rangeTo(a: Int): PrintWriter { print(a); print(" "); return this }
    operator fun PrintWriter.rangeTo(a: Long): PrintWriter { print(a); print(" "); return this }
    operator fun PrintWriter.rangeTo(a: IntArray): PrintWriter { a.forEach { print(it); print(" ") }; return this }
    operator fun PrintWriter.rangeTo(a: String): PrintWriter { write(a); return this }
} // @formatter:on

/* ----------- */

fun main() {
    var c = readLine()!!.toInt()
    var arr = readLine()!!.split(" ").map { it.toInt() }.toIntArray()
    var matrex = Array(arr.max()!!.toInt()) { Array(c) { 0 } }
    var i = 0
    for (col in 0 until c) {
        for (row in (arr.max()!! - 1)downTo 0) {
            if(arr[i] < arr.max()!!){
                matrex[row][col] = 0
                arr[i]++
            }else
                matrex[row][col] = 1
        }
        i++
    }

    var res = Array(c){0}
    var index = 0
    for(i in 0 until arr.max()!!) {
        var lineArray = matrex[i]
        for(j in 0 until lineArray.size){
            if(lineArray[j] == 1) {
                res[index]++
                index++
            }
        }
        index = 0
    }
    for(i in res.size-1 downTo 0)
        print("${res[i]} ")
}

private fun readLn() = readLine()!! // string line
private fun readInt() = readLn().toInt() // single int
private fun readStrings() = readLn().split(" ") // list of strings
private fun readInts() = readStrings().map { it.toInt() } // list of ints

fun main() {
    val s = readInt()

    val h = readInts().toMutableList()

    h.sort()

    println(h.joinToString(" "))
}

fun main(args: Array<String>) {
    val n = readInt()
    println(readInts().sorted().joinToString(" "))
}

private fun readInt() = readLine()!!.toInt()

private fun readInts() = readLine()!!.split(" ").map { it.toInt() }

fun main() {
    val n = readLine()!!.toInt()
    val a = readLine()!!.split(regex = "\\s".toRegex()).map { it.toInt() }.toTypedArray()
        .sorted()

    println(a.joinToString(separator = " "))
}

import java.io.BufferedReader
import java.io.InputStreamReader

fun main(args: Array<String>) {
    val reader = BufferedReader(InputStreamReader(System.`in`))
    var n = reader.readLine().toInt()
    val nums = reader.readLine().split(" ")
            .mapTo(mutableListOf(), { it.toInt() })

    var mismatch = true

    while (mismatch) {
        var counter = 0
        while (n - 1 != 0) {
            val difference = nums[n - 2] - nums[n - 1]
            if (difference > 0) {
                nums[n - 2] -= difference
                nums[n - 1] += difference
                counter++
            }
            n--
        }
        if(0 == counter) {
            mismatch = false
        }
        n = nums.size
    }
    nums.forEach({ print("$it ") })
}

import java.io.BufferedReader
import java.io.InputStreamReader

fun main() {
    val br = BufferedReader(InputStreamReader(System.`in`))
    val n = br.readLine().toInt()
    val a = br.readLine().split(" ").map { it.toInt() }
    val count = Array(101){0}
    for (a_i in a) {
        count[a_i]++
    }
    val ans = ArrayList<Int>()
    var i = 0
    while (i < count.size && ans.size < n) {
        if (count[i] > 0) {
            ans.add(i)
            count[i]--
        } else {
            i++
        }
    }
    println(ans.joinToString(" "))
}

import java.io.BufferedReader
import java.io.InputStreamReader

fun main() {
    val br = BufferedReader(InputStreamReader(System.`in`))
    val n = br.readLine().toInt()
    val a = br.readLine().split(" ").map { it.toInt() }
    val count = Array(105){0}
    for (a_i in a){
        count[a_i]++
    }

    val asorted = Array(n){0}
    var i = 0
    var j = 0

    while (i < count.size){
        if (count[i] != 0){
            asorted[j] = i
            count[i]--
            j++
        }else{
            i++
        }
    }
    println(asorted.joinToString(" "))
}

import java.util.*
import kotlin.math.abs

fun main(args: Array<String>) {
    val scan = Scanner(System.`in`)
    var numOfCol = scan.nextInt()
    val list = mutableListOf<Int>()
    while (numOfCol-->0) {
        val s =scan.nextInt()
        list.add(s)
    }
    list.sort()
    list.forEach {
        print("$it ")

    }
}

import kotlin.math.abs

fun readLn() = readLine()!! // string line
fun readInt() = readLn().toInt() // single int
fun readStrings() = readLn().split(" ") // list of strings
fun readInts() = readStrings().map { it.toInt() } // list of ints

fun findFlipCols(): List<Int> {
    val numCols = readInt()
    val colsVals = readInts()
    return colsVals.sorted()
}

fun main() {
    print(findFlipCols().joinToString(separator = " "))
}

fun main(args: Array<String>) {
    gravityChange()
}
fun gravityChange(){
    readLine()
    readLine()?.split(" ")?.map{ it.toInt()}?.sorted()?.forEach { print("$it ") }
}

import java.util.*
import kotlin.collections.ArrayList

fun main() {
    var n = readLine()!!.toInt()
    var list = readLine()!!.split(' ').map { it.toInt() }

    Collections.sort(list)
    for (i in list){
        print("$i ")
    }
}

fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    val heights = readLine()!!.split(' ').map { it.toInt() }
    val freqs = IntArray(101)
    for (h in heights) {
        (1..h).forEach { freqs[it]++ }
    }
    for (i in 1..n) {
        print("${freqs.count { it >= n - i + 1 }} ")
    }
    println()
}

import java.util.*

fun main(){
    val scan = Scanner(System.`in`)
    val n = scan.nextInt()
    val arr = IntArray(n)
    for (i in 0 until n) arr[i] = scan.nextInt()
    arr.sort()

    for (i in arr) print("$i ")
}

typealias int = Int

fun main() {
    var n = readLine()!!.toInt()
    var arr : IntArray= readLine()!!.split(' ').map { it.toInt() }.toIntArray()
   arr.sort()

    for( idx in 0..arr.lastIndex) {
        print("${arr[idx]} ")
    }
    println()
}

import java.lang.AssertionError
import java.util.*

private fun readLn() = readLine()!! // string line
private fun readInt() = readLn().toInt() // single int
private fun readLong() = readLn().toLong() // single long
private fun readDouble() = readLn().toDouble() // single double
private fun readStrings() = readLn().split(" ") // list of strings
private fun readInts() = readStrings().map { it.toInt() } // list of ints
private fun readLongs() = readStrings().map { it.toLong() } // list of longs
private fun readDoubles() = readStrings().map { it.toDouble() } // list of doubles

private fun myAssert(x: Boolean) {
    if (!x) {
        throw AssertionError()
    }
}

fun main(args: Array<String>) {
//  var s = Scanner(System.`in`)
  var n = readInt()
  var l = readInts()
  l = l.sorted()
  println(l.joinToString(" "))
}

import java.util.Scanner
import java.util.Arrays

fun main(args:Array<String>)
{
    var sc=Scanner(System.`in`)
    val n : Int = sc.nextInt()
    val a = IntArray(n)
    for(i in 0 until n)
    {
        a[i] = sc.nextInt()
    }
    Arrays.sort(a)
    for(i in 0 until n)
    {
        print(a[i])
        print(" ")
    }
}

fun main(args: Array<String>) {
    readLine()
    readLine()!!.split(' ').map(String::toInt).sorted().forEach {
        print("$it ")
    }
    print("\n")
}

fun main(args: Array<String>) {
    readLine()
    readLine()!!.split(' ').map(String::toInt).toTypedArray().sorted().forEach {
        print("$it ")
    }
    print("\n")
}

fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    val matrix = readLine()!!.split(' ').map { it.toInt() }.toMutableList()

    while ((n - 2 downTo 0).count {
                val delta = matrix[it] - matrix[it + 1]
                if (delta > 0) {
                    matrix[it] -= delta
                    matrix[it + 1] += delta
                }
                delta > 0
            } > 0){}

        println(matrix.joinToString(separator = " "))
}

fun main(args: Array<String>) {
    readLine()!!.toInt()
    val array = readLine()!!.split(' ').map { it.toInt() }.sorted()
    println(array.joinToString(" "))
}

fun main() {
    readLine()
    readLine()!!.split(' ').sorted().forEach { print("$it ") }
}

import java.io.BufferedReader
import java.io.InputStreamReader
import java.lang.StringBuilder

fun main(args: Array<String>) {
    val br = BufferedReader(InputStreamReader(System.`in`))
    br.readLine()
    val row = br.readLine().split("\\s+".toRegex())
    val sortedRow = row.sorted()
    val sb = StringBuilder()
    for (i in sortedRow)
        sb.append("$i ")
    sb.deleteCharAt(sb.length - 1)
    print(sb.toString())
}

private fun readLn() = readLine()!! // string line
private fun readInt() = readLn().toInt() // single int
private fun readStrings() = readLn().split(" ") // list of strings
private fun readInts() = readStrings().map { it.toInt() } // list of ints

fun main() {
    val s = readInt()

    val h = readInts().toMutableList()

    var c = 0

    // 4
    //3 2 1 2

    while (c < s-1) { // no point for the last grid
        var i = c;
        var moved = false

        while (i < s-1) {
            if (h[i] > h[i+1]) {
                val t = h[i] - h[i + 1]
                h[i] = h[i] - t
                h[i + 1] = h[i+1] + t
                moved = true
                i++
            } else {
                moved = false
                break
            }
        }

        if (!moved) {
            c++
        }
    }

    println(h.joinToString(" "))
}