from collections import Counter

H,W = list(map(int,input().split()))

src = [eval(input()) for i in range(H)]

counter = Counter()

for row in src:

    counter.update(row)



def solve():

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

        for n in list(counter.values()):

            if n%4 != 0: return False

        return True

    elif H%2 == 1 and W%2 == 1:

        odd = pairs = 0

        for n in list(counter.values()):

            if n%4 == 0: continue

            if n%2 == 1:

                if odd > 0: return False

                odd = 1

                if (n-1)%4 == 0: continue

            pairs += 2

            if pairs > H+W-1: return False

        return True

    else:

        even = (H if H%2 == 0 else W)

        pairs = 0

        for n in list(counter.values()):

            if n%4 == 0: continue

            if n%2 == 1: return False

            pairs += 2

            if pairs > even: return False

        return True



print(('Yes' if solve() else 'No'))

H,W = list(map(int,input().split()))

A = [eval(input()) for i in range(H)]

from collections import Counter

ctr = Counter()

for row in A:

    ctr.update(row)



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

    print(('Yes' if all(v%4==0 for v in list(ctr.values())) else 'No'))

elif H%2 and W%2:

    odd = 0

    for k,v in list(ctr.items()):

        if v%2:

            odd += 1

            ctr[k] -= 1

    if odd != 1:

        print('No')

        exit()

    four = 0

    for v in list(ctr.values()):

        four += (v//4)*4

    want = (H-H%2)*(W-W%2)

    print(('Yes' if four >= want else 'No'))

else:

    if any(v%2 for v in list(ctr.values())):

        print('No')

        exit()

    four = 0

    for v in list(ctr.values()):

        four += (v//4)*4

    want = (H-H%2)*(W-W%2)

    print(('Yes' if four >= want else 'No'))
from collections import Counter

H, W = list(map(int, input().split()))
src = [eval(input()) for i in range(H)]
counter = Counter()
for row in src:
    counter.update(row)


def solve():
    if H % 2 == 0 and W % 2 == 0:
        for n in list(counter.values()):
            if n % 4 != 0:
                return False
        return True
    elif H % 2 == 1 and W % 2 == 1:
        odd = pairs = 0
        for n in list(counter.values()):
            if n % 4 == 0:
                continue
            if n % 2 == 1:
                if odd > 0:
                    return False
                odd = 1
                if (n - 1) % 4 == 0:
                    continue
            pairs += 2
            if pairs > H + W - 1:
                return False
        return True
    else:
        even = H if H % 2 == 0 else W
        pairs = 0
        for n in list(counter.values()):
            if n % 4 == 0:
                continue
            if n % 2 == 1:
                return False
            pairs += 2
            if pairs > even:
                return False
        return True


print(("Yes" if solve() else "No"))

H, W = list(map(int, input().split()))
A = [eval(input()) for i in range(H)]
from collections import Counter

ctr = Counter()
for row in A:
    ctr.update(row)
if H % 2 == 0 and W % 2 == 0:
    print(("Yes" if all(v % 4 == 0 for v in list(ctr.values())) else "No"))
elif H % 2 and W % 2:
    odd = 0
    for k, v in list(ctr.items()):
        if v % 2:
            odd += 1
            ctr[k] -= 1
    if odd != 1:
        print("No")
        exit()
    four = 0
    for v in list(ctr.values()):
        four += (v // 4) * 4
    want = (H - H % 2) * (W - W % 2)
    print(("Yes" if four >= want else "No"))
else:
    if any(v % 2 for v in list(ctr.values())):
        print("No")
        exit()
    four = 0
    for v in list(ctr.values()):
        four += (v // 4) * 4
    want = (H - H % 2) * (W - W % 2)
    print(("Yes" if four >= want else "No"))

+H, W = list(map(int, input().split())) +A = [eval(input()) for i in range(H)] -H, W = list(map(int, input().split())) -src = [eval(input()) for i in range(H)] -counter = Counter() -for row in src: -    counter.update(row) - - -def solve(): -    if H % 2 == 0 and W % 2 == 0: -        for n in list(counter.values()): -            if n % 4 != 0: -                return False -        return True -    elif H % 2 == 1 and W % 2 == 1: -        odd = pairs = 0 -        for n in list(counter.values()): -            if n % 4 == 0: -                continue -            if n % 2 == 1: -                if odd > 0: -                    return False -                odd = 1 -                if (n - 1) % 4 == 0: -                    continue -            pairs += 2 -            if pairs > H + W - 1: -                return False -        return True -    else: -        even = H if H % 2 == 0 else W -        pairs = 0 -        for n in list(counter.values()): -            if n % 4 == 0: -                continue -            if n % 2 == 1: -                return False -            pairs += 2 -            if pairs > even: -                return False -        return True - - -print(("Yes" if solve() else "No")) +ctr = Counter() +for row in A: +    ctr.update(row) +if H % 2 == 0 and W % 2 == 0: +    print(("Yes" if all(v % 4 == 0 for v in list(ctr.values())) else "No")) +elif H % 2 and W % 2: +    odd = 0 +    for k, v in list(ctr.items()): +        if v % 2: +            odd += 1 +            ctr[k] -= 1 +    if odd != 1: +        print("No") +        exit() +    four = 0 +    for v in list(ctr.values()): +        four += (v // 4) * 4 +    want = (H - H % 2) * (W - W % 2) +    print(("Yes" if four >= want else "No")) +else: +    if any(v % 2 for v in list(ctr.values())): +        print("No") +        exit() +    four = 0 +    for v in list(ctr.values()): +        four += (v // 4) * 4 +    want = (H - H % 2) * (W - W % 2) +    print(("Yes" if four >= want else "No"))