import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.TreeSet;

class Main {
    public static void main(final String[] args) throws Exception {

        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in));) {
            List<String> inputNumberString = Arrays.asList(br.readLine().split(" "));
            int A = Integer.parseInt(inputNumberString.get(0));
            int B = Integer.parseInt(inputNumberString.get(1));

            List<String> postNumber = Arrays.asList(br.readLine().split("-"));

            if (postNumber.size() != 2) {
                System.out.println("No");
                return;
            }

            if (postNumber.get(0).length() != A) {
                System.out.println("No");
                return;
            }

            if (postNumber.get(1).length() != B) {
                System.out.println("No");
                return;
            }

            System.out.println("Yes");
        } catch (IOException | NumberFormatException e) {
            e.printStackTrace();
            System.exit(0);
        } catch (final Exception e) {
            e.printStackTrace();
            System.exit(0);
        }
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.ArrayList; ArrayList java.util import java.util.Arrays; Arrays java.util import java.util.HashSet; HashSet java.util import java.util.List; List java.util import java.util.Set; Set java.util import java.util.TreeSet; TreeSet java.util class Main {
    public static void main(final String[] args) throws Exception {

        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in));) {
            List<String> inputNumberString = Arrays.asList(br.readLine().split(" "));
            int A = Integer.parseInt(inputNumberString.get(0));
            int B = Integer.parseInt(inputNumberString.get(1));

            List<String> postNumber = Arrays.asList(br.readLine().split("-"));

            if (postNumber.size() != 2) {
                System.out.println("No");
                return;
            }

            if (postNumber.get(0).length() != A) {
                System.out.println("No");
                return;
            }

            if (postNumber.get(1).length() != B) {
                System.out.println("No");
                return;
            }

            System.out.println("Yes");
        } catch (IOException | NumberFormatException e) {
            e.printStackTrace();
            System.exit(0);
        } catch (final Exception e) {
            e.printStackTrace();
            System.exit(0);
        }
    }
} Main public static void main(final String[] args) throws Exception {

        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in));) {
            List<String> inputNumberString = Arrays.asList(br.readLine().split(" "));
            int A = Integer.parseInt(inputNumberString.get(0));
            int B = Integer.parseInt(inputNumberString.get(1));

            List<String> postNumber = Arrays.asList(br.readLine().split("-"));

            if (postNumber.size() != 2) {
                System.out.println("No");
                return;
            }

            if (postNumber.get(0).length() != A) {
                System.out.println("No");
                return;
            }

            if (postNumber.get(1).length() != B) {
                System.out.println("No");
                return;
            }

            System.out.println("Yes");
        } catch (IOException | NumberFormatException e) {
            e.printStackTrace();
            System.exit(0);
        } catch (final Exception e) {
            e.printStackTrace();
            System.exit(0);
        }
    } main {

        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in));) {
            List<String> inputNumberString = Arrays.asList(br.readLine().split(" "));
            int A = Integer.parseInt(inputNumberString.get(0));
            int B = Integer.parseInt(inputNumberString.get(1));

            List<String> postNumber = Arrays.asList(br.readLine().split("-"));

            if (postNumber.size() != 2) {
                System.out.println("No");
                return;
            }

            if (postNumber.get(0).length() != A) {
                System.out.println("No");
                return;
            }

            if (postNumber.get(1).length() != B) {
                System.out.println("No");
                return;
            }

            System.out.println("Yes");
        } catch (IOException | NumberFormatException e) {
            e.printStackTrace();
            System.exit(0);
        } catch (final Exception e) {
            e.printStackTrace();
            System.exit(0);
        }
    } try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in));) {
            List<String> inputNumberString = Arrays.asList(br.readLine().split(" "));
            int A = Integer.parseInt(inputNumberString.get(0));
            int B = Integer.parseInt(inputNumberString.get(1));

            List<String> postNumber = Arrays.asList(br.readLine().split("-"));

            if (postNumber.size() != 2) {
                System.out.println("No");
                return;
            }

            if (postNumber.get(0).length() != A) {
                System.out.println("No");
                return;
            }

            if (postNumber.get(1).length() != B) {
                System.out.println("No");
                return;
            }

            System.out.println("Yes");
        } catch (IOException | NumberFormatException e) {
            e.printStackTrace();
            System.exit(0);
        } catch (final Exception e) {
            e.printStackTrace();
            System.exit(0);
        } catch (IOException | NumberFormatException e) {
            e.printStackTrace();
            System.exit(0);
        } IOException | NumberFormatException e {
            e.printStackTrace();
            System.exit(0);
        } e.printStackTrace() e.printStackTrace e System.exit(0) System.exit System 0 catch (final Exception e) {
            e.printStackTrace();
            System.exit(0);
        } final Exception e {
            e.printStackTrace();
            System.exit(0);
        } e.printStackTrace() e.printStackTrace e System.exit(0) System.exit System 0 {
            List<String> inputNumberString = Arrays.asList(br.readLine().split(" "));
            int A = Integer.parseInt(inputNumberString.get(0));
            int B = Integer.parseInt(inputNumberString.get(1));

            List<String> postNumber = Arrays.asList(br.readLine().split("-"));

            if (postNumber.size() != 2) {
                System.out.println("No");
                return;
            }

            if (postNumber.get(0).length() != A) {
                System.out.println("No");
                return;
            }

            if (postNumber.get(1).length() != B) {
                System.out.println("No");
                return;
            }

            System.out.println("Yes");
        } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)) BufferedReader br = new BufferedReader(new InputStreamReader(System.in)) new BufferedReader(new InputStreamReader(System.in)) List<String> inputNumberString = Arrays.asList(br.readLine().split(" ")); inputNumberString Arrays.asList(br.readLine().split(" ")) Arrays.asList Arrays br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int A = Integer.parseInt(inputNumberString.get(0)); A Integer.parseInt(inputNumberString.get(0)) Integer.parseInt Integer inputNumberString.get(0) inputNumberString.get inputNumberString 0 int B = Integer.parseInt(inputNumberString.get(1)); B Integer.parseInt(inputNumberString.get(1)) Integer.parseInt Integer inputNumberString.get(1) inputNumberString.get inputNumberString 1 List<String> postNumber = Arrays.asList(br.readLine().split("-")); postNumber Arrays.asList(br.readLine().split("-")) Arrays.asList Arrays br.readLine().split("-") br.readLine().split br.readLine() br.readLine br "-" if (postNumber.size() != 2) {
                System.out.println("No");
                return;
            } postNumber.size() != 2 postNumber.size() postNumber.size postNumber 2 {
                System.out.println("No");
                return;
            } System.out.println("No") System.out.println System.out System System.out "No" return; if (postNumber.get(0).length() != A) {
                System.out.println("No");
                return;
            } postNumber.get(0).length() != A postNumber.get(0).length() postNumber.get(0).length postNumber.get(0) postNumber.get postNumber 0 A {
                System.out.println("No");
                return;
            } System.out.println("No") System.out.println System.out System System.out "No" return; if (postNumber.get(1).length() != B) {
                System.out.println("No");
                return;
            } postNumber.get(1).length() != B postNumber.get(1).length() postNumber.get(1).length postNumber.get(1) postNumber.get postNumber 1 B {
                System.out.println("No");
                return;
            } System.out.println("No") System.out.println System.out System System.out "No" return; System.out.println("Yes") System.out.println System.out System System.out "Yes" final String[] args args
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.TreeSet;

class Main {
    public static void main(final String[] args) throws Exception {

        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in));) {
            List<String> inputNumberString = Arrays.asList(br.readLine().split(" "));
            int A = Integer.parseInt(inputNumberString.get(0));
            int B = Integer.parseInt(inputNumberString.get(1));

            List<String> postNumber = Arrays.asList(br.readLine().split("-"));

            if (postNumber.size() != 2) {
                System.out.println("No");
                return;
            }

            if (postNumber.get(0).length() != A) {
                System.out.println("No");
                return;
            }

            if (postNumber.get(1).length() != B) {
                System.out.println("No");
                return;
            }

            System.out.println("Yes");
        } catch (IOException | NumberFormatException e) {
            e.printStackTrace();
            System.exit(0);
        } catch (final Exception e) {
            e.printStackTrace();
            System.exit(0);
        }
    }
}