import Control.Monad
import Data.List.Split
main = do
  [a, b] <- (map read . words) <$> getLine
  s <- getLine
  putStrLn $ cho a b s

cho:: Int -> Int -> String -> String
cho a b s = solve a b $ splitOn "-" s
  
solve:: Int -> Int -> [String] -> String
solve a b [] = "No"
solve a b s
  | ls /= 2 = "No"
  | ls1 == a && ls2 == b = "Yes"
  | otherwise =  "No"
  where
    ls = length s
    [s1, s2] = s
    ls1 = length s1
    ls2 = length s2
