(define (headc str)
  (substring str 0 1))

(define (rest-string str)
  (substring str 1 (string-length str)))

(define (check str left-rest -ed? right-rest)
  (cond
   [(string=? str "") (and (= left-rest 0)
			   -ed?
			   (= right-rest 0))]
   [(string=? (headc str) "-") (and (= left-rest 0)
				    (not -ed?)
				    (check (rest-string str) left-rest #t right-rest))]
   [(= left-rest 0) (check (rest-string str) left-rest -ed? (- right-rest 1))]
   [else (and (not -ed?)
	      (check (rest-string str) (- left-rest 1) -ed? right-rest))]))

(define A (read))
(define B (read))
(read-line)
(define str (read-line))
(print (if (check str A #f B) "Yes" "No"))
