import java.util.*;

public class Main {
    public static void main(String[] args) {
        
        // 定数
        final String RESULT_YES = "Yes";
        final String RESULT_NO = "No";
        
        Scanner sc = new Scanner(System.in);
        //Scanner sc = new Scanner("1 1\r\n999-0000");
        
        // ハイフンより前の文字数
        int postOfficeCode = sc.nextInt();
        // ハイフンより後の文字数
        int locationCode = sc.nextInt();
        // 評価対象文字列
        String val = sc.next();
        
        boolean result = false;
        
        if(val.matches("[0-9]{"+postOfficeCode+"}-[0-9]{"+locationCode+"}")) {
            result = true;
        }
        
        if(result) {
            System.out.println(RESULT_YES);
        } else {
            System.out.println(RESULT_NO);
        }
        
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        
        // 定数
        final String RESULT_YES = "Yes";
        final String RESULT_NO = "No";
        
        Scanner sc = new Scanner(System.in);
        //Scanner sc = new Scanner("1 1\r\n999-0000");
        
        // ハイフンより前の文字数
        int postOfficeCode = sc.nextInt();
        // ハイフンより後の文字数
        int locationCode = sc.nextInt();
        // 評価対象文字列
        String val = sc.next();
        
        boolean result = false;
        
        if(val.matches("[0-9]{"+postOfficeCode+"}-[0-9]{"+locationCode+"}")) {
            result = true;
        }
        
        if(result) {
            System.out.println(RESULT_YES);
        } else {
            System.out.println(RESULT_NO);
        }
        
    }
} Main public static void main(String[] args) {
        
        // 定数
        final String RESULT_YES = "Yes";
        final String RESULT_NO = "No";
        
        Scanner sc = new Scanner(System.in);
        //Scanner sc = new Scanner("1 1\r\n999-0000");
        
        // ハイフンより前の文字数
        int postOfficeCode = sc.nextInt();
        // ハイフンより後の文字数
        int locationCode = sc.nextInt();
        // 評価対象文字列
        String val = sc.next();
        
        boolean result = false;
        
        if(val.matches("[0-9]{"+postOfficeCode+"}-[0-9]{"+locationCode+"}")) {
            result = true;
        }
        
        if(result) {
            System.out.println(RESULT_YES);
        } else {
            System.out.println(RESULT_NO);
        }
        
    } main {
        
        // 定数
        final String RESULT_YES = "Yes";
        final String RESULT_NO = "No";
        
        Scanner sc = new Scanner(System.in);
        //Scanner sc = new Scanner("1 1\r\n999-0000");
        
        // ハイフンより前の文字数
        int postOfficeCode = sc.nextInt();
        // ハイフンより後の文字数
        int locationCode = sc.nextInt();
        // 評価対象文字列
        String val = sc.next();
        
        boolean result = false;
        
        if(val.matches("[0-9]{"+postOfficeCode+"}-[0-9]{"+locationCode+"}")) {
            result = true;
        }
        
        if(result) {
            System.out.println(RESULT_YES);
        } else {
            System.out.println(RESULT_NO);
        }
        
    } final String RESULT_YES = "Yes"; RESULT_YES "Yes" final String RESULT_NO = "No"; RESULT_NO "No" Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int postOfficeCode = sc.nextInt(); postOfficeCode sc.nextInt() sc.nextInt sc int locationCode = sc.nextInt(); locationCode sc.nextInt() sc.nextInt sc String val = sc.next(); val sc.next() sc.next sc boolean result = false; result false if(val.matches("[0-9]{"+postOfficeCode+"}-[0-9]{"+locationCode+"}")) {
            result = true;
        } val.matches("[0-9]{"+postOfficeCode+"}-[0-9]{"+locationCode+"}") val.matches val "[0-9]{"+postOfficeCode+"}-[0-9]{"+locationCode+"}" locationCode "}-[0-9]{" "[0-9]{"+postOfficeCode+"}-[0-9]{"+locationCode+"}" "[0-9]{" postOfficeCode "}-[0-9]{" locationCode "}" {
            result = true;
        } result = true result true if(result) {
            System.out.println(RESULT_YES);
        } else {
            System.out.println(RESULT_NO);
        } result {
            System.out.println(RESULT_YES);
        } System.out.println(RESULT_YES) System.out.println System.out System System.out RESULT_YES {
            System.out.println(RESULT_NO);
        } System.out.println(RESULT_NO) System.out.println System.out System System.out RESULT_NO String[] args args public class Main {
    public static void main(String[] args) {
        
        // 定数
        final String RESULT_YES = "Yes";
        final String RESULT_NO = "No";
        
        Scanner sc = new Scanner(System.in);
        //Scanner sc = new Scanner("1 1\r\n999-0000");
        
        // ハイフンより前の文字数
        int postOfficeCode = sc.nextInt();
        // ハイフンより後の文字数
        int locationCode = sc.nextInt();
        // 評価対象文字列
        String val = sc.next();
        
        boolean result = false;
        
        if(val.matches("[0-9]{"+postOfficeCode+"}-[0-9]{"+locationCode+"}")) {
            result = true;
        }
        
        if(result) {
            System.out.println(RESULT_YES);
        } else {
            System.out.println(RESULT_NO);
        }
        
    }
} public class Main {
    public static void main(String[] args) {
        
        // 定数
        final String RESULT_YES = "Yes";
        final String RESULT_NO = "No";
        
        Scanner sc = new Scanner(System.in);
        //Scanner sc = new Scanner("1 1\r\n999-0000");
        
        // ハイフンより前の文字数
        int postOfficeCode = sc.nextInt();
        // ハイフンより後の文字数
        int locationCode = sc.nextInt();
        // 評価対象文字列
        String val = sc.next();
        
        boolean result = false;
        
        if(val.matches("[0-9]{"+postOfficeCode+"}-[0-9]{"+locationCode+"}")) {
            result = true;
        }
        
        if(result) {
            System.out.println(RESULT_YES);
        } else {
            System.out.println(RESULT_NO);
        }
        
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) {
        
        // 定数
        final String RESULT_YES = "Yes";
        final String RESULT_NO = "No";
        
        Scanner sc = new Scanner(System.in);
        //Scanner sc = new Scanner("1 1\r\n999-0000");
        
        // ハイフンより前の文字数
        int postOfficeCode = sc.nextInt();
        // ハイフンより後の文字数
        int locationCode = sc.nextInt();
        // 評価対象文字列
        String val = sc.next();
        
        boolean result = false;
        
        if(val.matches("[0-9]{"+postOfficeCode+"}-[0-9]{"+locationCode+"}")) {
            result = true;
        }
        
        if(result) {
            System.out.println(RESULT_YES);
        } else {
            System.out.println(RESULT_NO);
        }
        
    }
}
