import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.regex.Matcher;
import java.util.regex.Pattern;


public class Main {

	/**
	 * @param args
	 * @throws IOException 
	 */
	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		String input = br.readLine();
		String[] tmpArray = input.split(" ");
		int a = Integer.parseInt(tmpArray[0]);
		int b = Integer.parseInt(tmpArray[1]);
		
		String posStr = br.readLine();
		String[] postal = posStr.split("-", -1);
//		Pattern p = Pattern.compile("[\\d]++");
//		Matcher m = p.matcher(arg0)
		boolean available = false;
		if(posStr.charAt(a) != '-'){
			available = false;
		}
		else if(postal.length != 2){
			available = false;
		}
		
//		else if(!postal[1].equals("-")){
//			available = false;
//		}
		else if(postal[0].length() == a && Pattern.matches("\\d++", postal[0])
			&& postal[1].length() == b && Pattern.matches("\\d++", postal[1])){
			available = true;
		}
		
		if(available){
			System.out.println("Yes");
		}
		else {
			System.out.println("No");
		}
	}

} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.regex.Matcher; Matcher java.util.regex import java.util.regex.Pattern; Pattern java.util.regex public class Main {

	/**
	 * @param args
	 * @throws IOException 
	 */
	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		String input = br.readLine();
		String[] tmpArray = input.split(" ");
		int a = Integer.parseInt(tmpArray[0]);
		int b = Integer.parseInt(tmpArray[1]);
		
		String posStr = br.readLine();
		String[] postal = posStr.split("-", -1);
//		Pattern p = Pattern.compile("[\\d]++");
//		Matcher m = p.matcher(arg0)
		boolean available = false;
		if(posStr.charAt(a) != '-'){
			available = false;
		}
		else if(postal.length != 2){
			available = false;
		}
		
//		else if(!postal[1].equals("-")){
//			available = false;
//		}
		else if(postal[0].length() == a && Pattern.matches("\\d++", postal[0])
			&& postal[1].length() == b && Pattern.matches("\\d++", postal[1])){
			available = true;
		}
		
		if(available){
			System.out.println("Yes");
		}
		else {
			System.out.println("No");
		}
	}

} Main /**
	 * @param args
	 * @throws IOException 
	 */
	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		String input = br.readLine();
		String[] tmpArray = input.split(" ");
		int a = Integer.parseInt(tmpArray[0]);
		int b = Integer.parseInt(tmpArray[1]);
		
		String posStr = br.readLine();
		String[] postal = posStr.split("-", -1);
//		Pattern p = Pattern.compile("[\\d]++");
//		Matcher m = p.matcher(arg0)
		boolean available = false;
		if(posStr.charAt(a) != '-'){
			available = false;
		}
		else if(postal.length != 2){
			available = false;
		}
		
//		else if(!postal[1].equals("-")){
//			available = false;
//		}
		else if(postal[0].length() == a && Pattern.matches("\\d++", postal[0])
			&& postal[1].length() == b && Pattern.matches("\\d++", postal[1])){
			available = true;
		}
		
		if(available){
			System.out.println("Yes");
		}
		else {
			System.out.println("No");
		}
	} main {
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		String input = br.readLine();
		String[] tmpArray = input.split(" ");
		int a = Integer.parseInt(tmpArray[0]);
		int b = Integer.parseInt(tmpArray[1]);
		
		String posStr = br.readLine();
		String[] postal = posStr.split("-", -1);
//		Pattern p = Pattern.compile("[\\d]++");
//		Matcher m = p.matcher(arg0)
		boolean available = false;
		if(posStr.charAt(a) != '-'){
			available = false;
		}
		else if(postal.length != 2){
			available = false;
		}
		
//		else if(!postal[1].equals("-")){
//			available = false;
//		}
		else if(postal[0].length() == a && Pattern.matches("\\d++", postal[0])
			&& postal[1].length() == b && Pattern.matches("\\d++", postal[1])){
			available = true;
		}
		
		if(available){
			System.out.println("Yes");
		}
		else {
			System.out.println("No");
		}
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String input = br.readLine(); input br.readLine() br.readLine br String[] tmpArray = input.split(" "); tmpArray input.split(" ") input.split input " " int a = Integer.parseInt(tmpArray[0]); a Integer.parseInt(tmpArray[0]) Integer.parseInt Integer tmpArray[0] tmpArray 0 int b = Integer.parseInt(tmpArray[1]); b Integer.parseInt(tmpArray[1]) Integer.parseInt Integer tmpArray[1] tmpArray 1 String posStr = br.readLine(); posStr br.readLine() br.readLine br String[] postal = posStr.split("-", -1); postal posStr.split("-", -1) posStr.split posStr "-" -1 1 boolean available = false; available false if(posStr.charAt(a) != '-'){
			available = false;
		}
		else if(postal.length != 2){
			available = false;
		}
		
//		else if(!postal[1].equals("-")){
//			available = false;
//		}
		else if(postal[0].length() == a && Pattern.matches("\\d++", postal[0])
			&& postal[1].length() == b && Pattern.matches("\\d++", postal[1])){
			available = true;
		} posStr.charAt(a) != '-' posStr.charAt(a) posStr.charAt posStr a '-' {
			available = false;
		} available = false available false if(postal.length != 2){
			available = false;
		}
		
//		else if(!postal[1].equals("-")){
//			available = false;
//		}
		else if(postal[0].length() == a && Pattern.matches("\\d++", postal[0])
			&& postal[1].length() == b && Pattern.matches("\\d++", postal[1])){
			available = true;
		} postal.length != 2 postal.length postal postal.length 2 {
			available = false;
		} available = false available false if(postal[0].length() == a && Pattern.matches("\\d++", postal[0])
			&& postal[1].length() == b && Pattern.matches("\\d++", postal[1])){
			available = true;
		} postal[0].length() == a && Pattern.matches("\\d++", postal[0])
			&& postal[1].length() == b && Pattern.matches("\\d++", postal[1]) postal[1].length() == b postal[0].length() == a && Pattern.matches("\\d++", postal[0])
			&& postal[1].length() == b && Pattern.matches("\\d++", postal[1]) postal[0].length() == a postal[0].length() postal[0].length postal[0] postal 0 a Pattern.matches("\\d++", postal[0]) Pattern.matches Pattern "\\d++" postal[0] postal 0 postal[1].length() == b postal[1].length() postal[1].length postal[1] postal 1 b Pattern.matches("\\d++", postal[1]) Pattern.matches Pattern "\\d++" postal[1] postal 1 {
			available = true;
		} available = true available true if(available){
			System.out.println("Yes");
		}
		else {
			System.out.println("No");
		} available {
			System.out.println("Yes");
		} System.out.println("Yes") System.out.println System.out System System.out "Yes" {
			System.out.println("No");
		} System.out.println("No") System.out.println System.out System System.out "No" String[] args args public class Main {

	/**
	 * @param args
	 * @throws IOException 
	 */
	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		String input = br.readLine();
		String[] tmpArray = input.split(" ");
		int a = Integer.parseInt(tmpArray[0]);
		int b = Integer.parseInt(tmpArray[1]);
		
		String posStr = br.readLine();
		String[] postal = posStr.split("-", -1);
//		Pattern p = Pattern.compile("[\\d]++");
//		Matcher m = p.matcher(arg0)
		boolean available = false;
		if(posStr.charAt(a) != '-'){
			available = false;
		}
		else if(postal.length != 2){
			available = false;
		}
		
//		else if(!postal[1].equals("-")){
//			available = false;
//		}
		else if(postal[0].length() == a && Pattern.matches("\\d++", postal[0])
			&& postal[1].length() == b && Pattern.matches("\\d++", postal[1])){
			available = true;
		}
		
		if(available){
			System.out.println("Yes");
		}
		else {
			System.out.println("No");
		}
	}

} public class Main {

	/**
	 * @param args
	 * @throws IOException 
	 */
	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		String input = br.readLine();
		String[] tmpArray = input.split(" ");
		int a = Integer.parseInt(tmpArray[0]);
		int b = Integer.parseInt(tmpArray[1]);
		
		String posStr = br.readLine();
		String[] postal = posStr.split("-", -1);
//		Pattern p = Pattern.compile("[\\d]++");
//		Matcher m = p.matcher(arg0)
		boolean available = false;
		if(posStr.charAt(a) != '-'){
			available = false;
		}
		else if(postal.length != 2){
			available = false;
		}
		
//		else if(!postal[1].equals("-")){
//			available = false;
//		}
		else if(postal[0].length() == a && Pattern.matches("\\d++", postal[0])
			&& postal[1].length() == b && Pattern.matches("\\d++", postal[1])){
			available = true;
		}
		
		if(available){
			System.out.println("Yes");
		}
		else {
			System.out.println("No");
		}
	}

} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.regex.Matcher;
import java.util.regex.Pattern;


public class Main {

	/**
	 * @param args
	 * @throws IOException 
	 */
	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		String input = br.readLine();
		String[] tmpArray = input.split(" ");
		int a = Integer.parseInt(tmpArray[0]);
		int b = Integer.parseInt(tmpArray[1]);
		
		String posStr = br.readLine();
		String[] postal = posStr.split("-", -1);
//		Pattern p = Pattern.compile("[\\d]++");
//		Matcher m = p.matcher(arg0)
		boolean available = false;
		if(posStr.charAt(a) != '-'){
			available = false;
		}
		else if(postal.length != 2){
			available = false;
		}
		
//		else if(!postal[1].equals("-")){
//			available = false;
//		}
		else if(postal[0].length() == a && Pattern.matches("\\d++", postal[0])
			&& postal[1].length() == b && Pattern.matches("\\d++", postal[1])){
			available = true;
		}
		
		if(available){
			System.out.println("Yes");
		}
		else {
			System.out.println("No");
		}
	}

}
