a = gets b = gets c = "YES" a.chars { |ch| c = "NO" if b.include?(ch) == false } puts c