(define n (read-line)) (define s (read-line)) (if (or (string=? s "010") (string=? s "101") (string=? s "01") (string=? s "10") (= (string-length s) 1)) (display "NO") (display "YES")) (newline)