using System;
    class AtCoderContest
    {
        static void Main()
        {
        string input = Console.ReadLine();
        string[] words = input.Split(' ', '-');
        string a = words[1];
        string b = words[2];
        string c = words[3];
        string d = words[4];
        int len1 = Convert.ToInt16(a);
        int len2 = Convert.ToInt16(b);
        if (len1 == c.Length)
        {
            if (len2 == d.Length)
            {
                Console.WriteLine("Yes");
            }
            else
            {
                Console.WriteLine("No");
            }
        }
        else
        {
            Console.WriteLine("No");
        }
        }
    }

