fun main(args:Array<String>) {
    val ans = if(Proc().getAns()) "Yes" else "No"
    println(ans)
}

class Proc() {
    val num = readLine()!!.split(" " ).map { it.toInt() }
    val s = readLine()!!
    fun getAns():Boolean {
        val splitted = s.split('-')
        if(splitted.size != 2) {
            return false
        }
        if(splitted[0].all { ('0'..'9').contains(it) } && splitted[1].all { ('0'..'9').contains(it) }) {

        } else {
            return false
        }
        return splitted[0].length == num[0] && splitted[1].length == num[1]
    }
}



