Bizon the Champion is called the Champion for a reason. 

Bizon the Champion has recently got a present — a new glass cupboard with n shelves and he decided to put all his presents there. All the presents can be divided into two types: medals and cups. Bizon the Champion has a_1 first prize cups, a_2 second prize cups and a_3 third prize cups. Besides, he has b_1 first prize medals, b_2 second prize medals and b_3 third prize medals. 

Naturally, the rewards in the cupboard must look good, that's why Bizon the Champion decided to follow the rules:  any shelf cannot contain both cups and medals at the same time;  no shelf can contain more than five cups;  no shelf can have more than ten medals. 

Help Bizon the Champion find out if we can put all the rewards so that all the conditions are fulfilled.


-----Input-----

The first line contains integers a_1, a_2 and a_3 (0 ≤ a_1, a_2, a_3 ≤ 100). The second line contains integers b_1, b_2 and b_3 (0 ≤ b_1, b_2, b_3 ≤ 100). The third line contains integer n (1 ≤ n ≤ 100).

The numbers in the lines are separated by single spaces.


-----Output-----

Print "YES" (without the quotes) if all the rewards can be put on the shelves in the described manner. Otherwise, print "NO" (without the quotes).


-----Examples-----
Input
1 1 1
1 1 1
4

Output
YES

Input
1 1 3
2 3 4
2

Output
YES

Input
1 0 0
1 0 0
1

Output
NO

Difficulty: interview

Starter code:

Solutions:
a = list(map(int, input().split()))
b = list(map(int, input().split()))
n = int(input())
n1 = (sum(a) - 1) // 5 + 1
n2 = (sum(b) - 1) // 10 + 1
if n1 + n2 <= n:
    print('YES')
else:
    print('NO')


a1, a2, a3 = map(int, input().split())
b1, b2, b3 = map(int, input().split())
n = int(input())
n -= (a1 + a2 + a3 - 1) // 5 + 1
n -= (b1 + b2 + b3 - 1) // 10 + 1
print('YES' if n >= 0 else 'NO')

import math

sa=input().split(' ')
sa2=input().split(' ')
sa3=int(input())

cups=[int(x) for x in sa]
medals=[int(x) for x in sa2]
if math.ceil(sum(cups)/5)+math.ceil(sum(medals)/10)>sa3:
    print("NO")
else:
    print("YES")


def main():
    a = sum(int(i) for i in input().split())
    b = sum(int(i) for i in input().split())
    n = int(input())
    
    if (a + 4) // 5 + (b + 9) // 10 > n:
        print("NO")
    else:
        print("YES")


main()


import math

a = list(map(int, input().split(" ")))
b = list(map(int, input().split(" ")))
n = int(input())
if math.ceil(sum(a)/5) + math.ceil(sum(b)/10) <= n:
    print("YES")
else:
    print("NO")

a = sum([int(x) for x in input().split()])
b = sum([int(x) for x in input().split()])
n = int(input())
an, bn = (a+4)//5, (b+9)//10
if an + bn <= n:
    print("YES")
else:
    print("NO")


b=sum(map(int,input().split()))
a=sum(map(int,input().split()))
n=int(input())
if a//10+b//5+(1 if a%10!=0 else 0)+(1 if b%5!=0 else 0)<=n:
    print('YES')
else:
    print('NO')


a = sum(map(int,input().split()))
b = sum(map(int,input().split()))
n = int(input())
if (a - 1) // 5 + 1 + (b - 1) // 10 + 1 > n:
    print('NO')
else:
    print('YES')

b = sum(list(map(int, input().split())))
a = sum(list(map(int, input().split())))
n = int(input())
if (a + 9) // 10 + (b + 4) // 5 <= n :
    print('YES')
else :
    print('NO')


from math import ceil
k = sum(map(int, input().split()))
m = sum(map(int, input().split()))
p = int(input())

k = ceil(k/5.)
m = ceil(m/10.)

if p-m-k>=0:
    print("YES")
else:
    print("NO")


a1, a2, a3 = list(map(int,input().split()))
b1, b2, b3 = list(map(int,input().split()))
n = int(input())
A = a1+a2+a3
B = b1+b2+b3
n1 = A//5
if A%5>0:   n1+=1
n2 = B//10
if B%10 > 0:  n2+=1
if n1+n2<=n:    print("YES")
else:   print("NO")

a=list(map(int, input().split()))
b=list(map(int, input().split()))
n=int(input())
a=sum(a)
b=sum(b)
n-=a//5
a=a%5
if a>0:
    n-=1
n-=b//10
if b%10>0:
    n-=1
if n<0:
    print('NO')
else:
    print('YES')


import math
a = list(map(int,input().split()))
b = list(map(int,input().split()))
n = int(input())

x = math.ceil(sum(a) / 5)
y = math.ceil(sum(b) / 10)

if (x + y) <= n :
    print("YES")
else:
    print("NO")

k=sum(map(int,input().split()))
m=sum(map(int,input().split()))
polki=int(input())
kp=(k//5)+1 if k%5 else k//5
mp=(m//10)+1 if m%10 else m//10
if(kp+mp)<=polki:
    print('YES')
else:
    print('NO')

from math import ceil
a, b, c = map(int, input().split())
d, e, f = map(int, input().split())
n = int(input())
k = a+b+c
l = d+e+f
if ceil(k/5) + ceil(l/10) <= n:
    print('YES')
else:
    print('NO')

s = input().split()
a1 = int(s[0])
a2 = int(s[1])
a3 = int(s[2])
s = input().split()
b1 = int(s[0])
b2 = int(s[1])
b3 = int(s[2])
n = int(input())
if (a1 + a2 + a3)%5 == 0:
    aa = (a1 + a2 + a3)//5
else:
    aa = (a1 + a2 + a3)//5 + 1

if (b1 + b2 + b3)%10 == 0:
    bb = (b1 + b2 + b3)//10
else:
    bb = (b1 + b2 + b3)//10 + 1

if aa + bb <= n:
    print('YES')
else:
    print('NO')


    
        


#Presents
#Codeforces 256

a,b,c=input().split()
d,e,f=input().split()

cups=int(a)+int(b)+int(c)

medals=int(d)+int(e)+int(f)

shelves=int(input())

while shelves>0:
    if cups>0:
        cups=cups-5
    elif cups<=0 and medals>0:
        medals=medals-10
    shelves=shelves-1

if cups<=0 and medals<=0:
    print("YES")

else:
    print("NO")


a1, a2, a3 = [int(x) for x in input().split(' ')]
b1, b2, b3 = [int(x) for x in input().split(' ')]
n = int(input())
at = (a1+a2+a3)//5; ar = (a1+a2+a3)%5
bt = (b1+b2+b3)//10; br = (b1+b2+b3)%10
if(ar > 0) : at = at+1
if(br > 0) : bt = bt+1
if(at+bt <= n) : print("YES")
else : print("NO")

"""
Codeforces Round 256 Div 2 Problem A

Author  : chaotic_iak
Language: Python 3.3.4
"""

def read(mode=2):
    # 0: String
    # 1: List of strings
    # 2: List of integers
    inputs = input().strip()
    if mode == 0:
        return inputs
    if mode == 1:
        return inputs.split()
    if mode == 2:
        return [int(x) for x in inputs.split()]

def write(s="\n"):
    if isinstance(s, list): s = " ".join(map(str,s))
    s = str(s)
    print(s, end="")

################################################### SOLUTION
a = sum(read())
b = sum(read())
n, = read()
if -(-a//5) - (-b//10) > n:
    print("NO")
else:
    print("YES")


cups = [int(i) for i in input().split(' ')]
medals = [int(i) for i in input().split(' ')]
shelves = int (input())

sCups = sum(cups)
sMedals = sum(medals)
k = 0
l = 0
if sCups%5 != 0:
    k = 1
if sMedals%10 != 0:
    l = 1
minShelvesRequired = int(sCups/5) + k + int(sMedals/10) + l

if minShelvesRequired <= shelves:
    print("YES")
else:
    print("NO")

a1,a2,a3 = map(int, input().split())
b1,b2,b3 = map(int, input().split())
n = int(input())
if((a1+a2+a3+4)//5+(b1+b2+b3+9)//10<=n):
	print('YES')
else:
	print('NO')

from math import ceil

a = list(map(int, input().split()))
b = list(map(int, input().split()))
n = int(input())

cups_space = ceil(sum(a)/5)
medals_space = ceil(sum(b)/10)

if cups_space+medals_space <= n:
	print('YES')
else:
	print('NO')


a1, a2, a3 = map(int, input().split())
b1, b2, b3 = map(int, input().split())
n = int(input())
k = (a1 + a2 + a3 + 4) // 5 + (b1 + b2 + b3 + 9) // 10
s = "YES" if k <= n else "NO"
print(s)

from math import ceil
a1, a2, a3 = map(int,input().split())
b1, b2, b3 = map(int,input().split())
n = int(input())
print ('YES') if ceil((a1+a2+a3)/5) + ceil((b1+b2+b3)/10) <= n else print('NO')