#d1502. 区间和
区间和
Range Sum
Problem Description
Xiaohong has a secret array of length . She will give you hints; the -th hint tells you the sum of the consecutive elements from to of array . Can you determine, from these hints, the sum of all elements of array ? If yes, output Yes; otherwise output No.
Input Format
The first line contains two integers and ; then there are lines, each containing two integers and .
Output Format
Output Yes or No, indicating whether the total sum can be determined.
Sample Input
4 3
1 3
1 2
2 3
Sample Output
No
Constraints
for