import re

n,m=input().split();print(('YNeos'[re.match(r'[0-9]{'+n+'}-[0-9]{'+m+'}',eval(input())) is None::2]))
import re

n,m=input().split();print(('YNeos'[not re.match(r'[0-9]{'+n+'}-[0-9]{'+m+'}',eval(input()))::2]))
import re

n, m = input().split()
print(
    (
        "YNeos"[
            re.match(r"[0-9]{" + n + "}-[0-9]{" + m + "}", eval(input())) is None :: 2
        ]
    )
)

import re

n, m = input().split()
print(("YNeos"[not re.match(r"[0-9]{" + n + "}-[0-9]{" + m + "}", eval(input())) :: 2]))

-print( -    ( -        "YNeos"[ -            re.match(r"[0-9]{" + n + "}-[0-9]{" + m + "}", eval(input())) is None :: 2 -        ] -    ) -) +print(("YNeos"[not re.match(r"[0-9]{" + n + "}-[0-9]{" + m + "}", eval(input())) :: 2]))