2009 weights are placed in a row. Each weight is of integer number of grams, and no weight is heavier than 1 kg. It turned out that each neighboring weights differ by exactly 1 g, while the total weight of all weights (in grams) is an even number. Prove that it is possible to partition all the weights into two sets with equal total weights.
В ряду из 2009 гирек вес каждой гирьки составляет целое число граммов и не превышает 1 кг. Веса любых двух соседних гирек отличаются ровно на 1 г, а общий вес всех гирь в граммах является чётным числом. Докажите, что гирьки можно разделить на две кучки, суммы весов в которых равны.