eolymp
bolt
Спробуйте наш новий інтерфейс для відправки розв'язків

Ropeway

Ліміт часу 8 секунд
Ліміт використання пам'яті 32 MiB

On a small island, there are two towns Darkside and Sunnyside, with steep mountains between them. There’s a company Intertown Company of Package Conveyance; they own a ropeway car between Darkside and Sunnyside and are running a transportation business. They want maximize the revenue by loading as much package as possible on the ropeway car.

The ropeway car looks like the following. It’s L length long, and the center of it is hung from the rope. Let’s suppose the car to be a 1-dimensional line segment, and a package to be a point lying on the line. You can put packages at anywhere including the edge of the car, as long as the distance between the package and the center of the car is greater than or equal to R and the car doesn’t fall down.

The car will fall down when the following condition holds:

Here N is the number of packages; m_i the weight of the i-th package; x_i is the position of the i-th package relative to the center of the car.

You, a Darkside programmer, are hired as an engineer of the company. Your task is to write a program which reads a list of package and checks if all the packages can be loaded in the listed order without the car falling down at any point.

Вхідні дані

The input has two lines, describing one test case. The first line contains four integers N, L, M, R. The second line contains N integers m_0, m_1, ..., m_{N-1}. The integers are separated by a space.

Вихідні дані

If there is a way to load all the packages, output "Yes" in one line, without the quotes. Otherwise, output "No".

Приклад

Вхідні дані #1
3 3 2 1
1 1 4
Вихідні дані #1
Yes
Джерело ACM-ICPC Japan Alumni Group Summer Camp 2010, Day 4, Tokyo, Japan, 2010-09-20