Cherry isn't feeling well right now as she found a problem that she couldn't solve. So she started to listen to Giveaway and you, to make her happy, have to solve the problem for her.
You are given two strings and
$b$. You have to find if there is a non-empty substring of
$a$ which is also a substring of .
A substring of a string is a contiguous subsequence of that string. So, string "cute" is substring of string "acute", but string "ace" is not.
The first line of the input contains the string
$a$ consisting only of lowercase Latin letters.
The next line contains the string
$b$ consisting only of lowercase Latin letters.
The length of each string is positive and doesn't exceed .
If there is a non-empty substring of
$a$ which is also a substring of , then output "YES"(without quotes) or output "NO"(without quotes) otherwise.
For example, the string "yo" is a substring of both "you" and "yourcrush".
Login to submit
Just check if there are at least one common characters between aaa and bbb