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()))

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

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'))

    exit()



if H%2 and W%2:

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

        if v%2:

            ctr[k] -= 1

            break

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

    print('No')

    exit()



if H%2 and W%2:

    two = W+H-1

elif H%2:

    two = W

else:

    two = H



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

    if v%4==0: continue

    if two <= 0:

        print('No')

        exit()

    two -= 2



print(('No' if two%4==2 else 'Yes'))
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()))
A = [eval(input()) for i in range(H)]
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"))
    exit()
if H % 2 and W % 2:
    for k, v in list(ctr.items()):
        if v % 2:
            ctr[k] -= 1
            break
if any(v % 2 for v in list(ctr.values())):
    print("No")
    exit()
if H % 2 and W % 2:
    two = W + H - 1
elif H % 2:
    two = W
else:
    two = H
for k, v in list(ctr.items()):
    if v % 4 == 0:
        continue
    if two <= 0:
        print("No")
        exit()
    two -= 2
print(("No" if two % 4 == 2 else "Yes"))

+from collections import Counter + -from collections import Counter - -elif H % 2 and W % 2: -    odd = 0 +    exit() +if H % 2 and W % 2: -            odd += 1 -    if odd != 1: +            break +if any(v % 2 for v in list(ctr.values())): +    print("No") +    exit() +if H % 2 and W % 2: +    two = W + H - 1 +elif H % 2: +    two = W +else: +    two = H +for k, v in list(ctr.items()): +    if v % 4 == 0: +        continue +    if two <= 0: -    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")) +    two -= 2 +print(("No" if two % 4 == 2 else "Yes"))