PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#GD0000137. Phân chia nho cho ba người (Got Any Grapes?)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Phân chia nho cho ba người (Got Any Grapes?)

Got Any Grapes?

Source: Codeforces

Version: Phuoc Hung OJ Extended

Problem Statement

There are aa green, bb purple, and cc black grapes. Andrew needs at least xx grapes and eats only green; Dmitry needs at least yy and eats green or purple; Michal needs at least zz and eats any color. Each grape may be given to at most one person. Decide whether everyone can be satisfied.

Input

The first line contains x,y,zx,y,z. The second line contains a,b,ca,b,c.

Output

Print YES if possible; otherwise NO.

Subtasks

  • Subtask 1 (20 points): 1≤x,y,z,a,b,c≤101\le x,y,z,a,b,c\le 10.
  • Subtask 2 (30 points): 1≤x,y,z,a,b,c≤10001\le x,y,z,a,b,c\le 1000.
  • Subtask 3 (50 points): 1≤x,y,z,a,b,c≤1000001\le x,y,z,a,b,c\le 100000.

Examples

Input

1 6 2
4 3 3

Output

YES

Explanation

Andrew receives one green grape; Dmitry gets the remaining three green and three purple grapes; Michal takes two black grapes. Everyone is satisfied.