Mockingbird


Submit solution

Points: 1
Time limit: 1.0s
Memory limit: 256M

Author:
Problem type
Allowed languages
C++, Java, Python

You just completed an RSP mock interview with a particularly clever cockatiel.

Scoring for the interview is composed of 3 sections:

  • A behavioural question, which has one score from 0 to 10 inclusive.
  • An easy LeetCode, which has five scores from 0 to 10 inclusive.
  • A medium LeetCode, which has five scores from 0 to 10 inclusive.

To pass the interview, all of your scores need to be at least 5. Are you destined to be the next legend of RSP?

Input

The first line contains a single integer, b (1 \leq b \leq 10), your score for the behavioural question.

The second line contains five integers, e_1, \dots, e_5, your scores for the easy LeetCode.

The third line contains five integers, m_1, \dots, m_5, your scores for the medium LeetCode.

Output

Output "Yes" if you have passed the mock interview, otherwise output "No".

Example

Input 1
5
10 8 9 7 6
5 10 2 5 5
Output 1
No

You got a score of 2 for one part of the medium LeetCode, so you failed the interview.

Input 2
9
5 6 7 6 7
5 8 9 5 5
Output 2
Yes
Input 3
4
10 10 10 10 10
10 10 10 10 10
Output 3
No

Comments

There are no comments at the moment.