Codeforces Round 538 (Div. 2)
A
Got Any Grapes?
Codeforces
800
原题
←B →
翻译中…
翻译中…

For simplicity, we'll assume that there are only three types of grapes: green grapes, purple grapes and black grapes.

翻译中…

Andrew, Dmitry and Michal are all grapes' lovers, however their preferences of grapes are different. To make all of them happy, the following should happen:

翻译中…
  • Andrew, Dmitry and Michal should eat at least $x$, $y$ and $z$ grapes, respectively.
  • Andrew has an extreme affinity for green grapes, thus he will eat green grapes and green grapes only.
  • On the other hand, Dmitry is not a fan of black grapes — any types of grapes except black would do for him. In other words, Dmitry can eat green and purple grapes.
  • Michal has a common taste — he enjoys grapes in general and will be pleased with any types of grapes, as long as the quantity is sufficient.
翻译中…

Knowing that his friends are so fond of grapes, Aki decided to host a grape party with them. He has prepared a box with $a$ green grapes, $b$ purple grapes and $c$ black grapes.

翻译中…

However, Aki isn't sure if the box he prepared contains enough grapes to make everyone happy. Can you please find out whether it's possible to distribute grapes so that everyone is happy or Aki has to buy some more grapes?

翻译中…

It is not required to distribute all the grapes, so it's possible that some of them will remain unused.

翻译中…

Input

翻译中…

The first line contains three integers $x$, $y$ and $z$ ($1 \le x, y, z \le 10^5$) — the number of grapes Andrew, Dmitry and Michal want to eat.

翻译中…

The second line contains three integers $a$, $b$, $c$ ($1 \le a, b, c \le 10^5$) — the number of green, purple and black grapes in the box.

翻译中…

Output

翻译中…

If there is a grape distribution that allows everyone to be happy, print "YES", otherwise print "NO".

翻译中…

Note

翻译中…

In the first example, there is only one possible distribution:

翻译中…

Andrew should take $1$ green grape, Dmitry should take $3$ remaining green grapes and $3$ purple grapes, and Michal will take $2$ out of $3$ available black grapes.

翻译中…

In the second test, there is no possible distribution, since Andrew is not be able to eat enough green grapes. :(

翻译中…

样例

Input #1
1 6 2
4 3 3
Output #1
YES
InputCopy OutputCopy
Input #2
5 1 1
4 3 2
Output #2
NO
InputCopy OutputCopy
题目信息
题号
1114A
时间限制
1 s
内存限制
256 MB
标签
暴力
贪心
模拟

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。