using System;
using System.Linq;
using System.Collections.Generic;
namespace Solution
{
    class Solution
    {
        static void Main(string[] args)
        {
            int[] x = System.Console.ReadLine().Trim().Split(' ').Select(z => int.Parse(z)).ToArray();
            try
            {
                string[] input = System.Console.ReadLine().Split('-');
                int a = int.Parse(input[0]);
                int b = int.Parse(input[1]);
                if (a.ToString().Length == x[0] && b.ToString().Length == x[1]) System.Console.WriteLine("Yes");
                else System.Console.WriteLine("No");
            }
            catch
            {
                System.Console.WriteLine("No");
            }
        }
    }
}
