Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p03485 (python)

Fixed submission:
import math
N = list(map(int,input().split()))

print(math.ceil((N[0]+N[1])/2))

Buggy submission (verdict: Runtime Error):
#sを最高のパターンにして，tを最悪のパターンにすればいい
#continueで強制的に次のループへ
s = list(input())
t = list(input())

s.sort()
t.sort()
t.reverse()

if len(s)  == len(t):
    pattern == -1
elif len(s) < len(t):
    length = len(s)
    pattern = 0
else:#sのほうが長い時 pattern = 1
    length = len(t)
    pattern = 1

if pattern == -1:
    for i in range(length):
        if s[i] == t[i]:
            continue
        elif s[i] < t[i]:
            print("Yes")
            quit()
        else:
            print("No")
            quit()
elif pattern == 0:
    for i in range(length):
        if s[i] == t[i]:
            continue
        elif s[i] < t[i]:
            print("Yes")
            quit()
        else:
            print("No")
            quit()
    print("Yes")
elif pattern == 1:
    for i in range(length):
        if s[i] == t[i]:
            continue
        elif s[i] < t[i]:
            print("Yes")
            quit()
        else:
            print("No")
            quit()
    print("No")

Buggy submission (verdict: Runtime Error):
N = map(int, input().split())

print( int((N[0]+N[1])/2) )
Problem p03487 (python)

Fixed submission:
N = int(input())

series = list(map(int, input().split()))

place = {}
counter = 0

for i in series:
    if i not in place:
        place[i] = 0
    place[i] += 1
    
for j in place.keys():
    if place[j] > j:
        counter += place[j] - j
    elif j > place[j]:
        counter += place[j]
        
print(counter)

Buggy submission (verdict: Runtime Error):
N = int(input())

series = list(map(int, input().split()))

place = [0 for _ in range(100000)]
counter = 0
max = 0

for i in series:
    place[i] += 1
    if i > max:
        max = i
    
for j in range(len(place)):
    if place[j] > j:
        counter += place[j] - j
    elif j > place[j]:
        counter += place[j]
        
print(counter)
Problem p03495 (python)

Fixed submission:
#N個のボールを持ち，K個以下の整数にする
#順当に考えるならば，種類が少ないやつから変更していけばいい
#番号の列をリストで表現
#押し付けきれるとは限らない

counter = 0

condition = list(map(int, input().split()))
A_list = list(map(int, input().split()))

zero_line = [0 for _ in range(200001)]

for i in A_list:
    if zero_line[i] == 0:
        counter += 1
    zero_line[i] += 1

zero_line.sort()
zero_line.reverse()

if counter <= condition[1]:
    print(0)
else:
    print(sum(zero_line[condition[1] :counter]))

Buggy submission (verdict: Runtime Error):
#N個のボールを持ち，K個以下の整数にする
#順当に考えるならば，種類が少ないやつから変更していけばいい
#番号の列をリストで表現
#押し付けきれるとは限らない

counter = 0

condition = list(map(int, input().split()))
A_list = list(map(int, input().split()))

zero_line = [0 for _ in range(condition[0])]

for i in A_list:
    if zero_line[i] == 0:
        counter += 1
    zero_line[i] += 1

zero_line.sort()
zero_line.reverse()

if counter <= condition[1]:
    print(0)
else:
    print(sum(zero_line[counter-condition[1]+1 :counter]))
Problem p03496 (python)

Fixed submission:
N = int(input())
series = list(map(int,input().split()))


series_sorted = series[:]
series_sorted.sort()

def make_no_decrease(condition, series):
    if condition == 0:#正の整数列
        for i in range(1,N):
            print(i, i+1)
    elif condition == 1:#負の整数列
        for i in range(1,N):
            print(N-i+1, N-i)
            
if series_sorted[0]  >= 0: #正の時
    print(len(series)-1)
    make_no_decrease(0, series)
elif series_sorted[-1] < 0: #負の時
    print(len(series)-1)
    make_no_decrease(1, series)
else:
    if abs(series_sorted[-1]) <= abs(series_sorted[0]): #負の値のほうが大きい時
        print(2*len(series)-1)
        min = series.index(series_sorted[0])
        for i in range(len(series)):
            print(min+1, i+1)
        make_no_decrease(1, series)
    elif abs(series_sorted[0]) < abs(series_sorted[-1]): #正の値のほうが大きい時
        print(2*len(series)-1)
        max = series.index(series_sorted[-1])
        for i in range(len(series)):
            print(max+1, i+1)
        make_no_decrease(0, series)

Buggy submission (verdict: Runtime Error):
N = int(input())
series = list(map(int,input().split()))


series_sorted = series[:]
series_sorted.sort()

def make_no_decrease(condition, series):
    if condition == 0:#正の整数列
        for i in range(1,N):
            print(i, i+1)
    elif condition == 1:#負の整数列
        for i in range(1,N):
            print(N-i+1, N-i)
            
if series_sorted[0]  >= 0: #正の時
    print(len(series)-1)
    make_no_decrease(0, series)
elif series_sorted[-1] < 0: #負の時
    print(len(series)-1)
    make_no_decrease(1, series)
else:
    if abs(series_sorted[-1]) <= abs(series_sorted[0]): #負の値のほうが大きい時
        print(2*len(series)-1)
        min = series.index(series_sorted[0])
        for i in range(len(series)):
            print(min+1, i)
        make_no_decrease(1, series)
    else abs(series_sorted[0]) < abs(series_sorted[-1]): #正の値のほうが大きい時
        print(2*len(series)-1)
        max = series.index(series_sorted[-1])
        for i in range(len(series)):
            print(max+1, i+1)
        make_no_decrease(0, series)

Buggy submission (verdict: Runtime Error):
N = int(input())
series = list(map(int,input().split()))


series_sorted = series[:]
series_sorted.sort()


def make_no_decrease(condition, series):
    if condition == 0:#正の整数列
        for i in range(1,N+1):
            print(i-1, i)
    elif condition == 1:#負の整数列
        for i in range(1,N+1):
            print(N-i-1, N-)
            
if series_sorted[0]  >= 0: #正の時
    make_no_decrease(0, series)
    print(len(series))
elif series_sorted[-1] <= 0: #負の時
    make_no_decrease(1, series)
    print(len(series))
elif abs(series_sorted[-1]) <= abs(series_sorted[0]): #負の値のほうが大きい時
    print(2*len(series))
    series = [series[i] + series[0] for  i in range(len(series))]
    for i in range(len(series)):
        print(1, i+1)
    make_no_decrease(1, series)
elif abs(series_sorted[0]) <= abs(series_sorted[-1]): #正の値のほうが大きい時
    print(2*len(series))
    series = [series[i] + series[-1] for  i in range(len(series))]
    for i in range(len(series)):
        print(N, i+1)
    make_no_decrease(0, series)
Problem p03501 (python)

Fixed submission:
#標準入力はN,A,Bで与えられる
numbers =input().split()

for  i in range(len(numbers)):
    numbers[i] = int(numbers[i])

if numbers[0]*numbers[1] <= numbers[2]:
    print(numbers[0]*numbers[1])
else:
    print(numbers[2])

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
n_shop = int(input())
i_schedule = []
i_benefit = []

max_profit = 0

#開店スケジュールを2進数→10進数に変換
for i in range(n_shop):
    i_schedule.append(int(input().replace(" ",""),2))
    
for i in range(n_shop):
    i_benefit.append(list(map(int,input().split())))
    max_profit += min(i_benefit[i])
    
#全パターンの開店スケジューるの作成
#一つ以上の時間帯で店は開店しなければならない

#schedule=[format(i, '010b') for i in range(1,1024)]
schedule = [i for  i in range(1,1024)]

#そこから一致数の計算→リストのcountメソッドを使う
for sch in schedule:
    anded = []
    for j in range(n_shop):
        anded.append(format(sch & i_schedule[j], "b").count("1"))     #一致スケジュールを2進数表記にして，1の数を計算
        
    profit = sum_benefit(anded)
    
    if max_profit <= profit:
        max_profit = profit
    
        
    

#最後に一致数から利益の計算
def sum_benefit(anded):
    summed= 0
    for shop in range(n_shop):
        sum += i_benefit[shop][anded[shop]]
    return summed

print(max_profit)

Buggy submission (verdict: Runtime Error):
#標準入力はN,A,Bで与えられる
numbers = int(input()).split()

for  i in range(len(numbers)):
    numbers[i] = int(numbers[i])

if numbers[0]*numbers[1] <= numbers[2]:
    print(numbers[0]*numbers[1])
else:
    print(numbers[2])

Buggy submission (verdict: Runtime Error):
#標準入力はN,A,Bで与えられる
numbers = raw_input().split()

for  i in range(len(numbers)):
    numbers[i] = int(numbers[i])

if numbers[0]*numbers[1] <= numbers[2]:
    print(numbers[0]*numbers[1])
else:
    print(numbers[2])
Problem p03503 (python)

Fixed submission:
# -*- Coding: utf-8 -*-
def sum_benefit(anded):
    summed= 0
    for shop in range(n_shop):
        summed += i_benefit[shop][anded[shop]]
    return summed

n_shop = int(input())
i_schedule = []
i_benefit = []


max_profit = 0

#開店スケジュールを2進数→10進数に変換
for i in range(n_shop):
    i_schedule.append(int(input().replace(" ",""),2))
    
for i in range(n_shop):
    i_benefit.append(list(map(int,input().split())))
    max_profit += min(i_benefit[i])
    
#全パターンの開店スケジューるの作成
#一つ以上の時間帯で店は開店しなければならない

#schedule=[format(i, '010b') for i in range(1,1024)]
schedule = [i for  i in range(1,1024)]

#そこから一致数の計算→リストのcountメソッドを使う
for sch in schedule:
    anded = []
    for j in range(n_shop):
        anded.append(format(sch & i_schedule[j], "b").count("1"))     #一致スケジュールを2進数表記にして，1の数を計算
        
    profit = sum_benefit(anded)
    
    if max_profit <= profit:
        max_profit = profit
    

print(max_profit)

Buggy submission (verdict: Runtime Error):
# -*- Coding: utf-8 -*-
n_shop = int(input())
i_schedule = []
i_benefit = []

max_profit = 0

#開店スケジュールを2進数→10進数に変換
for i in range(n_shop):
    i_schedule.append(int(input().replace(" ",""),2))
    
for i in range(n_shop):
    i_benefit.append(list(map(int,input().split())))
    max_profit += min(i_benefit[i])
    
#全パターンの開店スケジューるの作成
#一つ以上の時間帯で店は開店しなければならない

#schedule=[format(i, '010b') for i in range(1,1024)]
schedule = [i for  i in range(1,1024)]

#そこから一致数の計算→リストのcountメソッドを使う
for sch in schedule:
    anded = []
    for j in range(n_shop):
        anded.append(format(sch & i_schedule[j], "b").count("1"))     #一致スケジュールを2進数表記にして，1の数を計算
        
    profit = sum_benefit(anded)
    
    if max_profit <= profit:
        max_profit = profit
    
        
    

#最後に一致数から利益の計算
def sum_benefit(anded):
    summed= 0
    for shop in range(n_shop):
        sum += i_benefit[shop][anded[shop]]
    return summed

print(max_profit)
Problem p03544 (python)

Fixed submission:
N = int(input())

ryuka = [0]*87
ryuka[0] = 2
ryuka[1] = 1

def culc_ryuka(N, ryuka):
    for i in range(2, N+1):
        ryuka[i] = ryuka[i-1]+ryuka[i-2]
        
    return ryuka

ryuka = culc_ryuka(N, ryuka)
print(ryuka[N])

Buggy submission (verdict: Runtime Error):
N = int(input())

ryuka = [0]*86
ryuka[0] = 2
ryuka[1] = 1

def culc_ryuka(N, ryuka):
    for i in range(2, N+1):
        ryuka[i] = ryuka[i-1]+ryuka[i-2]
        
    return ryuka

ryuka = culc_ryuka(N, ryuka)
print(ryuka[N])
Problem p03545 (python)

Fixed submission:
n = input()
b_l = []
for i in range(8):
  b = bin(i)[2:]
  le = len(b)
  b_l.append((3 - le)*"0" + b)


    

s_l = [int(n[i]) for i in range(4)]
    
for b in b_l:
  ans = s_l[0]
  f = 0
  b_s_l = ["+" if b[i] == "0" else "-" for i in range(3)]
  for i in range(3):
    if b_s_l[i] == "+":
      ans += s_l[i+1]
    else:
      ans -= s_l[i+1]
  if ans == 7:
    print(str(s_l[0]) + b_s_l[0] + str(s_l[1]) + b_s_l[1] + str(s_l[2]) + 
          b_s_l[2] + str(s_l[3]) + "=7") 
    break

Buggy submission (verdict: Runtime Error):
n = input()

for i in range(n):
  print(bin(n))
Problem p03591 (python)

Fixed submission:
# coding: utf-8
import sys

s = input()

if len(s) < 4:
    print("No")
    sys.exit()
if s[0]=='Y' and s[1]=='A' and s[2] == 'K' and s[3] == 'I':
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
s = input()

if s[0]=='Y' and s[1]=='A' and s[2] == 'K' and s[3] == 'I':
    print("Yes")
else:
    print("No")
Problem p03155 (python)

Fixed submission:
N = int(input())
H = int(input())
W = int(input())
 
ANS = (N-(H-1))*(N-(W-1))
 
print(ANS)

Buggy submission (verdict: Runtime Error):
N = int(input())
H = int(input())
W = int(input())
 
ANS = (N-(H-1))(N-(W-1))
 
print(ANS)
Problem p03149 (python)

Fixed submission:
a = [int(i) for i in input().split()] 
b = []
for i in a:
    if i in [2, 3, 5, 6, 8]:
        print("NO")
        break
    elif i in b:
        print("NO")
        break
    else:
        b.append(i)
        if len(b) == 4:
            print("YES")

Buggy submission (verdict: Runtime Error):
num = [1, 9, 7, 4]
for i in a:
    if i not in a:
        print("NO")
        break
    else:
        num.remove(i)
        if len(num) == 0:
            print("YES")
Problem p03200 (python)

Fixed submission:
list1=list(input())
list1.reverse()
a=0
count=0
for i in range(len(list1)):
    if list1[i]=="W":
        a=i
        break
for i in range(a,len(list1)):
    if list1[i]=="B":
        count+=i-a
        a+=1
print(count)

Buggy submission (verdict: Runtime Error):
list1=list(input())
list1.reverse()
count=0
for i in range(len(list1)):
    if list1[i]=="W":
        a=i
        break
for i in range(a+1,len(list1)):
    if list1[i]=="B":
        count+=i-a
        a+=1
print(count)
Problem p03200 (python)

Fixed submission:
# -*- coding: utf-8 -*-


def main():
    """Function."""
    s = str(input())

    total = 0
    b_count = 0
    for i in range(len(s)):
        if s[i] == "B":
            b_count += 1
        if s[i] == "W":
            total += b_count

    print(total)


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-


def main():
    """Function."""
    s = str(input())
    num = len(s)

    total = 0
    s_list = list(s)
    for _ in range(num):
        if s_list == []:
            break

        b_c, w_c = 0, -1
        while s_list[b_c] == "W":
            b_c += 1
        while s_list[w_c] == "B":
            w_c -= 1
        if b_c == 0:
            pass
        else:
            del s_list[:b_c]
        if w_c == -1:
            pass
        else:
            del s_list[w_c+1:]

        if s_list == []:
            break

        for i in range(num-1):
            end = num - i
            start = end - 2
            if s_list[start:end] == ["B", "W"]:
                total += 1
                s_list[start:end] = ["W", "B"]
    print(total)


if __name__ == "__main__":
    main()
Problem p03385 (python)

Fixed submission:
# -*- coding: utf-8 -*-


def main():
    """Function."""
    s = str(input())
    if len(set([s[0], s[1], s[2]])) == 3:
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-


def main():
    """Function."""
    s = str(input())
    if len(set(s[0], s[1], s[2])) == 3:
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    main()
Problem p03424 (python)

Fixed submission:
# -*- coding: utf-8 -*-


def main():
    """Function."""
    n = int(input())
    s = list(map(str, input().split()))

    check = set()
    for i in range(n):
        check.add(s[i])

    if len(check) == 3:
        print("Three")
    else:
        print("Four")


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-


def main():
    """Function."""
    n = int(input())
    s = list(map(str, input().split()))

    check = set()
    for i in range(n):
        check.append(s[i])

    if len(check) == 3:
        print("Three")
    else:
        print("Four")


if __name__ == "__main__":
    main()
Problem p03698 (python)

Fixed submission:
# -*- coding: utf-8 -*-


def main():
    """Function."""
    s = str(input())
    check = set()

    for i in range(len(s)):
        check.add(s[i])

    if len(s) != len(check):
        print("no")
    else:
        print("yes")


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-


def main():
    """Function."""
    s = str(input())

    check = set()
    for i in range(s):
        check.add(s[i])

    if len(s) != len(s):
        print("no")
    else:
        print("yes")


if __name__ == "__main__":
    main()
Problem p03826 (python)

Fixed submission:
# -*- coding: utf-8 -*-


def main():
    """Function."""
    a, b, c, d = map(int, input().split())
    print(max(a*b, c*d))


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-


def main():
    """Function."""
    a, b, c, d = map(str, input().split())
    print(max(a*b, c*d))


if __name__ == "__main__":
    main()
Problem p03854 (python)

Fixed submission:
# -*- coding: utf-8 -*-

def check(string):
    if string[-5:] == "dream":
        new = string[:-5]
        return new

    if string[-7:] == "dreamer":
        new = string[:-7]
        return new

    if string[-5:] == "erase":
        new = string[:-5]
        return new

    if string[-6:] == "eraser":
        new = string[:-6]
        return new

    print("NO")


if __name__ == '__main__':
    s = str(input())

    while s:
        s = check(s)

    if s == "":
        print("YES")

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

def check(string):
    if string[-5:] == "dream":
        new = string[:-5]
        return new

    if string[-7:] == "dreamer":
        new = string[:-7]
        return new

    if string[-5:] == "erase":
        new = string[:-5]
        return new

    if string[-6:] == "eraser":
        new = string[:-6]
        return new

    print("NO")


if __name__ == '__main__':
    s = str(input())

    while s:
        print(s)
        s = check(s)

    if s == "":
        print("YES")
Problem p03569 (python)

Fixed submission:
#!/usr/bin/env python3
import sys

s = input()

swox = "".join(list(filter("x".__ne__, list(s))))

# print(s, swox)
def is_palind(a):
    for i in range(len(a)//2):
        if a[i] != a[-i-1]:
            return False
    return True

if not is_palind(swox):
    print(-1)
    sys.exit(0)
#
l = 0
r = -1
count = 0
# print(s)
while True:
    # print(l, r+len(s))
    # print(s[l],s[r])
    if l >= r+len(s):
        break
    if s[l] == "x" and s[r] == "x":
        l += 1
        r -= 1
    elif s[l] == "x":
        l += 1
        count += 1
    elif s[r] == "x":
        r -= 1
        count += 1
    else:
        l += 1
        r -= 1
print(count)

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
import sys

s = input()

swox = "".join(list(filter("x".__ne__, list(s))))

# print(s, swox)
def is_palind(a):
    for i in range(len(a)//2):
        if a[i] != a[-i-1]:
            return False
    return True

if not is_palind(swox):
    print(-1)
    sys.exit(0)
#
l = 0
r = -1
count = 0
# print(s)
while True:
    # print(l, r+len(s))
    # print(s[l],s[r])
    if l == r+len(s):
        break
    if s[l] == "x" and s[r] == "x":
        l += 1
        r -= 1
    elif s[l] == "x":
        l += 1
        count += 1
    elif s[r] == "x":
        r -= 1
        count += 1
    else:
        l += 1
        r -= 1
print(count)
Problem p03576 (python)

Fixed submission:
from itertools import combinations

N, K = map(int, input().split())
points = []
for i in range(N):
    points.append(list(map(int, input().split())))

xl = list(map(lambda p: p[0],
              points))
yl = list(map(lambda p: p[1],
              points))

def contained(point, xmin, xmax, ymin, ymax):
    return (xmin <= point[0] <= xmax) and (ymin <= point[1] <= ymax)

def count_contained(xmin, xmax, ymin, ymax):
    count = 0
    for point in points:
        if contained(point, xmin, xmax, ymin, ymax):
            count += 1
    return count

min_area = 10**20
for xs in combinations(xl, 2):
    xmin = min(xs)
    xmax = max(xs)
    for ys in combinations(yl, 2):
        ymin = min(ys)
        ymax = max(ys)
        if count_contained(xmin, xmax, ymin, ymax) >= K:
            area = (xmax-xmin) * (ymax-ymin)
            min_area = min(area, min_area)
print(min_area)

Buggy submission (verdict: Runtime Error):
from itertools import combinations

N, K = map(int, input().split())
points = []
for i in range(N):
    points.append(list(map(int, input().split())))

points.sort(key=lambda p:p[0])


min_area = 10**20
for k in range(K, N+1):
    for l in range(0, N-k+1):
        points_tmp = points[l:l+k-1]
        points_tmp.sort(key=lambda p:p[1])
        for m in range(0, N-K+1):
            points_selected = points_tmp[m, m+K-1]
            ymin = points_selected[0][1]
            ymax = points_selected[-1][1]
            points_selected.sort(key=lambda p:p[0])
            xmin = points_selected[0][0]
            xmax = points_selected[-1][0]
            area = (xmax-xmin) * (ymax-ymin)
            min_area = min(area, min_area)

print(min_area)

Buggy submission (verdict: Runtime Error):
from itertools import combinations

N, K = map(int, input().split())
points = []
for i in range(N):
    points.append(list(map(int, input().split())))

points.sort(key=lambda p:p[0])


min_area = 10**20
for k in range(K, N+1):
    for l in range(0, N-k+1):
        points_tmp = points[l:l+k-1]
        points_tmp.sort(key=lambda p:p[1])
        for m in range(0, N-K+1):
            points_selected = points_tmp[m, m+K-1]
            ymin = points_selected[0][1]
            ymax = points_selected[-1][1]
            points_selected.sort(key=lambda p:p[0])
            xmin = points_selected[0][0]
            xmax = points_selected[-1][0]
            area = (xmax-xmin) * (ymax-ymin)
            min_area = min(area, min_area)

print(min_area)
Problem p03593 (python)

Fixed submission:
#!/usr/bin/env python3

H, W = map(int, input().split())
a = ""
for i in range(H):
    a += input()

# count = {}
count_all = len(a)
count_4 = 0
count_2 = 0
count_1 = 0

for s in "abcdefghijklmnopqrstuvwxyz":
    # count[s] = a.count(s)
    c = a.count(s)
    count_4 += c//4
    c = c%4
    count_2 += c//2
    c = c%2
    count_1 += c

if W%2 == 1 and H%2 == 0:
    W, H = H, W

if W%2 == 0 and H%2 == 0:
    if count_4 < W*H//4:
        print("No")
    else:
        print("Yes")
elif W%2 == 0 and H%2 == 1:
    if count_4 < W*(H-1)//4:
        # print(count_4, W*(H-1)//4)
        print("No")
    elif 2*(count_4 - W*(H-1)//4) + count_2 < W//2:
        print("No")
    else:
        print("Yes")
else:
    if count_4 < (W-1)*(H-1)//4:
        print("No")
    elif 2*(count_4 - (W-1)*(H-1)//4) + count_2 < (W+H-2)//2:
        print("No")
    else:
        print("Yes")

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
import sys

H, W = map(int, input().split())
a = ""
for i in range(H):
    a += input()

# count = {}
count_all = len(a)
count_4 = 0
count_2 = 0
count_1 = 0

for s in "abcdefghijklmnopqrstuvwxyz":
    # count[s] = a.count(s)
    c = a.count(s)
    count_4 += c//4
    c = c%4
    count_2 += c//2
    c = c%2
    count_1 += c

if W%2 == 1 and H%2 == 0:
    W, H = H, W

if W%2 == 0 and H%2 == 0:
    if count_4 < W*H//4:
        print("No")
    else:
        print("Yes")
elif W%2 == 0 and H%2 == 1:
    if count_4 < W*(H-1)//4:
        # print(count_4, W*(H-1)//4)
        sys.stderr.write((count_4, W*(H-1)//4))
        print("No")
    elif 2*(count_4 - W*(H-1)//4) + count_2 < W//2:
        print("No")
    else:
        print("Yes")
else:
    if count_4 < (W-1)*(H-1)//4:
        print("No")
    elif 2*(count_4 - (W-1)*(H-1)//4) + count_2 < (W+H-2)//2:
        print("No")
    else:
        print("Yes")