Buggy python submission (verdict: Runtime Error):
a = list(map(int,input().split()))
S = input()

b = list(S.split("-"))

a.sort()
b.sort()

if a[0] == len(b[0]) and a[1] == len(b[1]):
    print("Yes")
elif sum(a) == len(b[1]):
    print("Yes")
else:
    print("No")


Fixed submission:
import re
A,B = list(map(int,input().split()))
S = input()

d = re.compile("\d+")

if (d.match(S[:A])) and S[A] == "-" and d.match(S[A+1:]):
    print("Yes")

else:print("No")

Buggy python submission (verdict: Runtime Error):
import re
import sys
A,B = map(int,input().split())
S = input()


if S.count("-") == 1:
    s1,s2 = S.split("-")
    result = re.match(f"^[0-9]", s1)

    for x in range(2):
        if x == 1:
            result = re.match(f"^[0-9]", s2)
        if result:
            continue
        else:
            print("No")
            sys.exit(0)

    judgment = s1
    n = A
    for x in range(2):
        if x == 1:
            judgment = s2
            n = B
        if len(judgment) == n:
            continue
        else:
            print("No")
            sys.exit(0)

    print("Yes")
else:
    print("No")


Fixed submission:
import re
A,B = list(map(int,input().split()))
S = input()

d = re.compile("\d+")

if (d.match(S[:A])) and S[A] == "-" and d.match(S[A+1:]):
    print("Yes")

else:print("No")

Buggy python submission (verdict: Runtime Error):
import re
A,B = map(int,input().split())
S = input()


if S.count("-") == 1:
    s1,s2 = S.split("-")
    result = re.match(f"^[0-9]", s1)

    for x in range(2):
        if x == 1:
            result = re.match(f"^[0-9]", s2)
        if result:
            continue
        else:
            print("No")
            sys.exit(0)

    judgment = s1
    n = A
    for x in range(2):
        if x == 1:
            judgment = s2
            n = B
        if len(judgment) == n:
            continue
        else:
            print("No")
            sys.exit(0)

    print("Yes")
else:
    print("No")


Fixed submission:
import re
A,B = list(map(int,input().split()))
S = input()

d = re.compile("\d+")

if (d.match(S[:A])) and S[A] == "-" and d.match(S[A+1:]):
    print("Yes")

else:print("No")

Buggy python submission (verdict: Runtime Error):
A,B = map(int,input().split())
S = input()

if S.count("-") == 1:
    s1,s2 = S.split("-")
    if len(s1) == A:
        if len(s2) == B:
            print("Yes")
        else:
            print("No")
            sys.exit(0)
    elif len(s2) == A:
        if len(s1) == B:
            print("Yes")
        else:
            print("No")
            sys.exit(0)
    else:
        print("No")
        sys.exit(0)
else:
    print("No")


Fixed submission:
import re
A,B = list(map(int,input().split()))
S = input()

d = re.compile("\d+")

if (d.match(S[:A])) and S[A] == "-" and d.match(S[A+1:]):
    print("Yes")

else:print("No")

Buggy python submission (verdict: Runtime Error):
A,B = map(int,input().split())
S = input()

if S.count("-") == 1:
    s1,s2 = S.split("-")
    if len(s1) == A:
        if len(s2) == B:
            print("Yes")
        else:
            print("No")
    elif len(s2) == A:
        if len(s1) == B:
            print("Yes")
        else:
            print("No")
    else:
        print("No")
        sys.exit(0)
else:
    print("No")


Fixed submission:
import re
A,B = list(map(int,input().split()))
S = input()

d = re.compile("\d+")

if (d.match(S[:A])) and S[A] == "-" and d.match(S[A+1:]):
    print("Yes")

else:print("No")

Buggy python submission (verdict: Runtime Error):
A,B = map(int,input().split())
S = input()

if S.count("-") == 1:
    s1,s2 = S.split("-")
    if len(s1) == A:
        if len(s2) == B:
            print("Yes")
    elif len(s1) == A:
        if len(s2) == B:
            print("Yes")
    else:
        print("No")
        sys.exit(0)
else:
    print("No")


Fixed submission:
import re
A,B = list(map(int,input().split()))
S = input()

d = re.compile("\d+")

if (d.match(S[:A])) and S[A] == "-" and d.match(S[A+1:]):
    print("Yes")

else:print("No")