#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int N, V, distance, max_oil, consume, add_oil, oil;
  int i, j, flag = 0;
  scanf("%d%d", &N, &V);
  oil = V;
  for (i = 0; i < N; i++) {
    scanf("%d%d", &consume, &add_oil);
    oil = oil - consume;
    if (oil < 0)
      flag = 1;
    else {
      oil = oil + add_oil;
      if (oil > V)
        oil = V;
    }
  }
  if (flag == 1)
    printf("No\n");
  else
    printf("Yes\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x2c(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11c9 <main+0xa9>
lea    0xe96(%rip),%rdi
lea    -0x18(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x20(%rbp),%eax
sub    -0x18(%rbp),%eax
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jge    1196 <main+0x76>
movl   $0x1,-0x2c(%rbp)
jmp    11b6 <main+0x96>
mov    -0x20(%rbp),%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    11b1 <main+0x91>
mov    -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
jmp    11b6 <main+0x96>
jmp    11bb <main+0x9b>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1157 <main+0x37>
cmpl   $0x1,-0x2c(%rbp)
jne    11e4 <main+0xc4>
lea    0xe2b(%rip),%rdi
call   1030 <printf@plt>
jmp    11f0 <main+0xd0>
lea    0xe1e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xecb(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1040 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
jle    11b1 <main+0x91>
xor    %r12d,%r12d
mov    0x8(%rsp),%ebp
lea    0xea7(%rip),%r14
lea    0x14(%rsp),%r15
lea    0x10(%rsp),%r13
xor    %ebx,%ebx
jmp    1186 <main+0x66>
nopw   0x0(%rax,%rax,1)
add    0x10(%rsp),%ebp
mov    0x8(%rsp),%eax
cmp    %eax,%ebp
cmovg  %eax,%ebp
add    $0x1,%ebx
cmp    0xc(%rsp),%ebx
jge    11a2 <main+0x82>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r13,%rdx
call   1040 <scanf@plt>
sub    0x14(%rsp),%ebp
jns    1170 <main+0x50>
mov    $0x1,%r12d
jmp    117d <main+0x5d>
cmp    $0x1,%r12d
jne    11b1 <main+0x91>
lea    0xe5a(%rip),%rdi
jmp    11b8 <main+0x98>
lea    0xe4d(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [4 x i8] c"No\0A\00"
@.str.2 = [5 x i8] c"Yes\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %11
%12 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%13 = load i32, i32* %3
store i32 %13, i32* %8
store i32 0, i32* %9
br label %14
14: ; preds = %37, %0
%15 = load i32, i32* %9
%16 = load i32, i32* %2
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %40
18: ; preds = %14
%19 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %6, i32* %7)
%20 = load i32, i32* %8
%21 = load i32, i32* %6
%22 = sub nsw i32 %20, %21
store i32 %22, i32* %8
%23 = load i32, i32* %8
%24 = icmp slt i32 %23, 0
br i1 %24, label %25, label %26
25: ; preds = %18
store i32 1, i32* %11
br label %36
26: ; preds = %18
%27 = load i32, i32* %8
%28 = load i32, i32* %7
%29 = add nsw i32 %27, %28
store i32 %29, i32* %8
%30 = load i32, i32* %8
%31 = load i32, i32* %3
%32 = icmp sgt i32 %30, %31
br i1 %32, label %33, label %35
33: ; preds = %26
%34 = load i32, i32* %3
store i32 %34, i32* %8
br label %35
35: ; preds = %33, %26
br label %36
36: ; preds = %35, %25
br label %37
37: ; preds = %36
%38 = load i32, i32* %9
%39 = add nsw i32 %38, 1
store i32 %39, i32* %9
br label %14
40: ; preds = %14
%41 = load i32, i32* %11
%42 = icmp eq i32 %41, 1
br i1 %42, label %43, label %45
43: ; preds = %40
%44 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %47
45: ; preds = %40
%46 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %47
47: ; preds = %45, %43
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%d%d\00"
@str = [4 x i8] c"Yes\00"
@str.3 = [3 x i8] c"No\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%10 = load i32, i32* %1
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %36
12: ; preds = %0
%13 = load i32, i32* %2
br label %14
14: ; preds = %12, %28
%15 = phi i32 [ %30, %28 ], [ 0, %12 ]
%16 = phi i32 [ %29, %28 ], [ %13, %12 ]
%17 = phi i32 [ %31, %28 ], [ 0, %12 ]
%18 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %3, i32* %4)
%19 = load i32, i32* %3
%20 = sub nsw i32 %16, %19
%21 = icmp slt i32 %20, 0
br i1 %21, label %28, label %22
22: ; preds = %14
%23 = load i32, i32* %4
%24 = add nsw i32 %23, %20
%25 = load i32, i32* %2
%26 = icmp sgt i32 %24, %25
%27 = select i1 %26, i32 %25, i32 %24
br label %28
28: ; preds = %22, %14
%29 = phi i32 [ %20, %14 ], [ %27, %22 ]
%30 = phi i32 [ 1, %14 ], [ %15, %22 ]
%31 = add nuw nsw i32 %17, 1
%32 = load i32, i32* %1
%33 = icmp slt i32 %31, %32
br i1 %33, label %14, label %34
34: ; preds = %28
%35 = icmp eq i32 %30, 1
br i1 %35, label %37, label %36
36: ; preds = %0, %34
br label %37
37: ; preds = %34, %36
%38 = phi i8* [ getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0), %36 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @str.3, i64 0, i64 0), %34 ]
%39 = call i32 @puts(i8* dereferenceable(1) %38)
ret i32 0
}