from collections import defaultdict

from sys import exit



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

char_counter = defaultdict(int)



for _ in range(H):

    for s in eval(input()):

        char_counter[s] += 1



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

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

        if v % 4 != 0:

            print("No")

            exit()

    print("Yes")

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

    holder = defaultdict(int)

    counter = 0

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

        if v % 4 != 0:

            for _ in range(v % 4):

                holder[k] += 1

                counter += 1

    if counter <= H:

        for kk, vv in list(holder.items()):

            if vv % 2 != 0:

                print("No")

                exit()

        print("Yes")

    else:

        print("No")

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

    holder = defaultdict(int)

    counter = 0

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

        if v % 4 != 0:

            for _ in range(v % 4):

                holder[k] += 1

                counter += 1

    if counter <= W:

        for kk, vv in list(holder.items()):

            if vv % 2 != 0:

                print("No")

                exit()

        print("Yes")

    else:

        print("No")

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

    holder = defaultdict(int)

    counter = 0

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

        if v % 4 != 0:

            for _ in range(v % 4):

                holder[k] += 1

                counter += 1

    if counter <= W + H - 1:

        no_odd = False

        for kk, vv in list(holder.items()):

            if vv % 2 != 0:

                if no_odd:

                    print("No")

                    exit()

                else:

                    no_odd = True

        print("Yes")

    else:

        print("No")

def main():

    import sys

    input = sys.stdin.readline

    from collections import defaultdict

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

    counter = defaultdict(int)

    for _ in range(H):

        for s in input().rstrip():

            counter[s] += 1

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

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

            if cnt % 4 != 0:

                print("No")

                sys.exit()

        print("Yes")

        sys.exit()

    

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

        one_cnt = 0

        two_cnt = 0

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

            if cnt % 4 != 0:

                if cnt % 2 == 0:

                    two_cnt += 1

                else:

                    one_cnt += 1

        if two_cnt <= H // 2 + W // 2 and one_cnt <= 1:

            print("Yes")

        else:

            print("No")

        sys.exit()

    

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

        two_cnt = 0

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

            if cnt % 4 != 0:

                if cnt % 2 == 0:

                    two_cnt += 1

                else:

                    print("No")

                    sys.exit()

        if two_cnt <= W // 2:

            print("Yes")

        else:

            print("No")

        sys.exit() 



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

        two_cnt = 0

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

            if cnt % 4 != 0:

                if cnt % 2 == 0:

                    two_cnt += 1

                else:

                    print("No")

                    sys.exit()

        if two_cnt <= H // 2:

            print("Yes")

        else:

            print("No")

        sys.exit() 



if __name__ == '__main__':

    main()
from collections import defaultdict
from sys import exit

H, W = list(map(int, input().split()))
char_counter = defaultdict(int)
for _ in range(H):
    for s in eval(input()):
        char_counter[s] += 1
if H % 2 == 0 and W % 2 == 0:
    for k, v in list(char_counter.items()):
        if v % 4 != 0:
            print("No")
            exit()
    print("Yes")
elif H % 2 == 0 and W % 2 == 1:
    holder = defaultdict(int)
    counter = 0
    for k, v in list(char_counter.items()):
        if v % 4 != 0:
            for _ in range(v % 4):
                holder[k] += 1
                counter += 1
    if counter <= H:
        for kk, vv in list(holder.items()):
            if vv % 2 != 0:
                print("No")
                exit()
        print("Yes")
    else:
        print("No")
elif H % 2 == 1 and W % 2 == 0:
    holder = defaultdict(int)
    counter = 0
    for k, v in list(char_counter.items()):
        if v % 4 != 0:
            for _ in range(v % 4):
                holder[k] += 1
                counter += 1
    if counter <= W:
        for kk, vv in list(holder.items()):
            if vv % 2 != 0:
                print("No")
                exit()
        print("Yes")
    else:
        print("No")
elif H % 2 == 1 and W % 2 == 1:
    holder = defaultdict(int)
    counter = 0
    for k, v in list(char_counter.items()):
        if v % 4 != 0:
            for _ in range(v % 4):
                holder[k] += 1
                counter += 1
    if counter <= W + H - 1:
        no_odd = False
        for kk, vv in list(holder.items()):
            if vv % 2 != 0:
                if no_odd:
                    print("No")
                    exit()
                else:
                    no_odd = True
        print("Yes")
    else:
        print("No")

def main():
    import sys

    input = sys.stdin.readline
    from collections import defaultdict

    H, W = list(map(int, input().split()))
    counter = defaultdict(int)
    for _ in range(H):
        for s in input().rstrip():
            counter[s] += 1
    if H % 2 == 0 and W % 2 == 0:
        for cnt in list(counter.values()):
            if cnt % 4 != 0:
                print("No")
                sys.exit()
        print("Yes")
        sys.exit()
    if H % 2 == 1 and W % 2 == 1:
        one_cnt = 0
        two_cnt = 0
        for cnt in list(counter.values()):
            if cnt % 4 != 0:
                if cnt % 2 == 0:
                    two_cnt += 1
                else:
                    one_cnt += 1
        if two_cnt <= H // 2 + W // 2 and one_cnt <= 1:
            print("Yes")
        else:
            print("No")
        sys.exit()
    if H % 2 == 1 and W % 2 == 0:
        two_cnt = 0
        for cnt in list(counter.values()):
            if cnt % 4 != 0:
                if cnt % 2 == 0:
                    two_cnt += 1
                else:
                    print("No")
                    sys.exit()
        if two_cnt <= W // 2:
            print("Yes")
        else:
            print("No")
        sys.exit()
    if H % 2 == 0 and W % 2 == 1:
        two_cnt = 0
        for cnt in list(counter.values()):
            if cnt % 4 != 0:
                if cnt % 2 == 0:
                    two_cnt += 1
                else:
                    print("No")
                    sys.exit()
        if two_cnt <= H // 2:
            print("Yes")
        else:
            print("No")
        sys.exit()


if __name__ == "__main__":
    main()

-from collections import defaultdict -from sys import exit +def main(): +    import sys -H, W = list(map(int, input().split())) -char_counter = defaultdict(int) -for _ in range(H): -    for s in eval(input()): -        char_counter[s] += 1 -if H % 2 == 0 and W % 2 == 0: -    for k, v in list(char_counter.items()): -        if v % 4 != 0: +    input = sys.stdin.readline +    from collections import defaultdict + +    H, W = list(map(int, input().split())) +    counter = defaultdict(int) +    for _ in range(H): +        for s in input().rstrip(): +            counter[s] += 1 +    if H % 2 == 0 and W % 2 == 0: +        for cnt in list(counter.values()): +            if cnt % 4 != 0: +                print("No") +                sys.exit() +        print("Yes") +        sys.exit() +    if H % 2 == 1 and W % 2 == 1: +        one_cnt = 0 +        two_cnt = 0 +        for cnt in list(counter.values()): +            if cnt % 4 != 0: +                if cnt % 2 == 0: +                    two_cnt += 1 +                else: +                    one_cnt += 1 +        if two_cnt <= H // 2 + W // 2 and one_cnt <= 1: +            print("Yes") +        else: -            exit() -    print("Yes") -elif H % 2 == 0 and W % 2 == 1: -    holder = defaultdict(int) -    counter = 0 -    for k, v in list(char_counter.items()): -        if v % 4 != 0: -            for _ in range(v % 4): -                holder[k] += 1 -                counter += 1 -    if counter <= H: -        for kk, vv in list(holder.items()): -            if vv % 2 != 0: -                print("No") -                exit() -        print("Yes") -    else: -        print("No") -elif H % 2 == 1 and W % 2 == 0: -    holder = defaultdict(int) -    counter = 0 -    for k, v in list(char_counter.items()): -        if v % 4 != 0: -            for _ in range(v % 4): -                holder[k] += 1 -                counter += 1 -    if counter <= W: -        for kk, vv in list(holder.items()): -            if vv % 2 != 0: -                print("No") -                exit() -        print("Yes") -    else: -        print("No") -elif H % 2 == 1 and W % 2 == 1: -    holder = defaultdict(int) -    counter = 0 -    for k, v in list(char_counter.items()): -        if v % 4 != 0: -            for _ in range(v % 4): -                holder[k] += 1 -                counter += 1 -    if counter <= W + H - 1: -        no_odd = False -        for kk, vv in list(holder.items()): -            if vv % 2 != 0: -                if no_odd: +        sys.exit() +    if H % 2 == 1 and W % 2 == 0: +        two_cnt = 0 +        for cnt in list(counter.values()): +            if cnt % 4 != 0: +                if cnt % 2 == 0: +                    two_cnt += 1 +                else: -                    exit() +                    sys.exit() +        if two_cnt <= W // 2: +            print("Yes") +        else: +            print("No") +        sys.exit() +    if H % 2 == 0 and W % 2 == 1: +        two_cnt = 0 +        for cnt in list(counter.values()): +            if cnt % 4 != 0: +                if cnt % 2 == 0: +                    two_cnt += 1 -                    no_odd = True -        print("Yes") -    else: -        print("No") +                    print("No") +                    sys.exit() +        if two_cnt <= H // 2: +            print("Yes") +        else: +            print("No") +        sys.exit() + + +if __name__ == "__main__": +    main()