h,w=list(map(int,input().split()))

ans=[['']*w for _ in range(h)]

char={}

for _ in range(h):

  s=eval(input())

  for c in s:

    if c not in char:

      char[c]=1

    else:

      char[c]+=1

ch=h//2

cw=w//2

fh=False

fw=False

if h%2==1:

  ch+=1

  fh=True

if w%2==1:

  cw+=1

  fw=True

for i in range(ch):

  for j in range(cw):

    if (i==ch-1 and fh==True) and (j==cw-1 and fw==True):

      for c in list(char.keys()):

        if char[c]%2==1:

          ans[i][j]=c

          char[c]-=1

          if char[c]==0:

            del char[c]

          break

    elif i==ch-1 and fh==True:

      for c in list(char.keys()):

        if char[c]%4==2:

          ans[i][j]=c

          ans[i][w-j-1]=c

          char[c]-=2

          if char[c]==0:

            del char[c]

          break

      else:

        for c in list(char.keys()):

          if char[c]>=2:

            ans[i][j]=c

            ans[i][w-j-1]=c

            char[c]-=2

            if char[c]==0:

              del char[c]

            break

    elif j==cw-1 and fw==True:

      for c in list(char.keys()):

        if char[c]%4==2:

          ans[i][j]=c

          ans[h-i-1][j]=c

          char[c]-=2

          if char[c]==0:

            del char[c]

          break

      else:

        for c in list(char.keys()):

          if char[c]>=2:

            ans[i][j]=c

            ans[h-i-1][j]=c

            char[c]-=2

            if char[c]==0:

              del char[c]

            break

    else:

      for c in list(char.keys()):

        if char[c]>=4:

          ans[i][j]=c

          ans[i][w-j-1]=c

          ans[h-i-1][j]=c

          ans[h-i-1][w-j-1]=c

          char[c]-=4

          if char[c]==0:

            del char[c]

          break

fy=True

for i in range(ch):

  for j in range(cw):

    if ans[i][j]=='':

      fy=False

if fy==True:

  print('Yes')

else:

  print('No')
h,w=list(map(int,input().split()))

char={}

for _ in range(h):

  s=eval(input())

  for c in s:

    if c not in char:

      char[c]=1

    else:

      char[c]+=1

cnt4=(h//2)*(w//2)

cnt2=0

cnt1=0

if h%2==1 and w%2==1:

  cnt1=1

  cnt2=h//2+w//2

elif h%2==1:

  cnt2=w//2

elif w%2==1:

  cnt2=h//2

flag=True

for _ in range(cnt4):

  for c in list(char.keys()):

    if char[c]>=4:

      char[c]-=4

      if char[c]==0:

        del char[c]

      break

  else:

    flag=False

for _ in range(cnt2):

  for c in list(char.keys()):

    if char[c]>=2:

      char[c]-=2

      if char[c]==0:

        del char[c]

      break

  else:

    flag=False

for _ in range(cnt1):

  for c in list(char.keys()):

    if char[c]>=1:

      char[c]-=1

      if char[c]==0:

        del char[c]

      break

  else:

    flag=False

if flag==True:

  print('Yes')

else:

  print('No')
h, w = list(map(int, input().split()))
ans = [[""] * w for _ in range(h)]
char = {}
for _ in range(h):
    s = eval(input())
    for c in s:
        if c not in char:
            char[c] = 1
        else:
            char[c] += 1
ch = h // 2
cw = w // 2
fh = False
fw = False
if h % 2 == 1:
    ch += 1
    fh = True
if w % 2 == 1:
    cw += 1
    fw = True
for i in range(ch):
    for j in range(cw):
        if (i == ch - 1 and fh == True) and (j == cw - 1 and fw == True):
            for c in list(char.keys()):
                if char[c] % 2 == 1:
                    ans[i][j] = c
                    char[c] -= 1
                    if char[c] == 0:
                        del char[c]
                    break
        elif i == ch - 1 and fh == True:
            for c in list(char.keys()):
                if char[c] % 4 == 2:
                    ans[i][j] = c
                    ans[i][w - j - 1] = c
                    char[c] -= 2
                    if char[c] == 0:
                        del char[c]
                    break
            else:
                for c in list(char.keys()):
                    if char[c] >= 2:
                        ans[i][j] = c
                        ans[i][w - j - 1] = c
                        char[c] -= 2
                        if char[c] == 0:
                            del char[c]
                        break
        elif j == cw - 1 and fw == True:
            for c in list(char.keys()):
                if char[c] % 4 == 2:
                    ans[i][j] = c
                    ans[h - i - 1][j] = c
                    char[c] -= 2
                    if char[c] == 0:
                        del char[c]
                    break
            else:
                for c in list(char.keys()):
                    if char[c] >= 2:
                        ans[i][j] = c
                        ans[h - i - 1][j] = c
                        char[c] -= 2
                        if char[c] == 0:
                            del char[c]
                        break
        else:
            for c in list(char.keys()):
                if char[c] >= 4:
                    ans[i][j] = c
                    ans[i][w - j - 1] = c
                    ans[h - i - 1][j] = c
                    ans[h - i - 1][w - j - 1] = c
                    char[c] -= 4
                    if char[c] == 0:
                        del char[c]
                    break
fy = True
for i in range(ch):
    for j in range(cw):
        if ans[i][j] == "":
            fy = False
if fy == True:
    print("Yes")
else:
    print("No")

h, w = list(map(int, input().split()))
char = {}
for _ in range(h):
    s = eval(input())
    for c in s:
        if c not in char:
            char[c] = 1
        else:
            char[c] += 1
cnt4 = (h // 2) * (w // 2)
cnt2 = 0
cnt1 = 0
if h % 2 == 1 and w % 2 == 1:
    cnt1 = 1
    cnt2 = h // 2 + w // 2
elif h % 2 == 1:
    cnt2 = w // 2
elif w % 2 == 1:
    cnt2 = h // 2
flag = True
for _ in range(cnt4):
    for c in list(char.keys()):
        if char[c] >= 4:
            char[c] -= 4
            if char[c] == 0:
                del char[c]
            break
    else:
        flag = False
for _ in range(cnt2):
    for c in list(char.keys()):
        if char[c] >= 2:
            char[c] -= 2
            if char[c] == 0:
                del char[c]
            break
    else:
        flag = False
for _ in range(cnt1):
    for c in list(char.keys()):
        if char[c] >= 1:
            char[c] -= 1
            if char[c] == 0:
                del char[c]
            break
    else:
        flag = False
if flag == True:
    print("Yes")
else:
    print("No")

-ans = [[""] * w for _ in range(h)] -ch = h // 2 -cw = w // 2 -fh = False -fw = False -if h % 2 == 1: -    ch += 1 -    fh = True -if w % 2 == 1: -    cw += 1 -    fw = True -for i in range(ch): -    for j in range(cw): -        if (i == ch - 1 and fh == True) and (j == cw - 1 and fw == True): -            for c in list(char.keys()): -                if char[c] % 2 == 1: -                    ans[i][j] = c -                    char[c] -= 1 -                    if char[c] == 0: -                        del char[c] -                    break -        elif i == ch - 1 and fh == True: -            for c in list(char.keys()): -                if char[c] % 4 == 2: -                    ans[i][j] = c -                    ans[i][w - j - 1] = c -                    char[c] -= 2 -                    if char[c] == 0: -                        del char[c] -                    break -            else: -                for c in list(char.keys()): -                    if char[c] >= 2: -                        ans[i][j] = c -                        ans[i][w - j - 1] = c -                        char[c] -= 2 -                        if char[c] == 0: -                            del char[c] -                        break -        elif j == cw - 1 and fw == True: -            for c in list(char.keys()): -                if char[c] % 4 == 2: -                    ans[i][j] = c -                    ans[h - i - 1][j] = c -                    char[c] -= 2 -                    if char[c] == 0: -                        del char[c] -                    break -            else: -                for c in list(char.keys()): -                    if char[c] >= 2: -                        ans[i][j] = c -                        ans[h - i - 1][j] = c -                        char[c] -= 2 -                        if char[c] == 0: -                            del char[c] -                        break -        else: -            for c in list(char.keys()): -                if char[c] >= 4: -                    ans[i][j] = c -                    ans[i][w - j - 1] = c -                    ans[h - i - 1][j] = c -                    ans[h - i - 1][w - j - 1] = c -                    char[c] -= 4 -                    if char[c] == 0: -                        del char[c] -                    break -fy = True -for i in range(ch): -    for j in range(cw): -        if ans[i][j] == "": -            fy = False -if fy == True: +cnt4 = (h // 2) * (w // 2) +cnt2 = 0 +cnt1 = 0 +if h % 2 == 1 and w % 2 == 1: +    cnt1 = 1 +    cnt2 = h // 2 + w // 2 +elif h % 2 == 1: +    cnt2 = w // 2 +elif w % 2 == 1: +    cnt2 = h // 2 +flag = True +for _ in range(cnt4): +    for c in list(char.keys()): +        if char[c] >= 4: +            char[c] -= 4 +            if char[c] == 0: +                del char[c] +            break +    else: +        flag = False +for _ in range(cnt2): +    for c in list(char.keys()): +        if char[c] >= 2: +            char[c] -= 2 +            if char[c] == 0: +                del char[c] +            break +    else: +        flag = False +for _ in range(cnt1): +    for c in list(char.keys()): +        if char[c] >= 1: +            char[c] -= 1 +            if char[c] == 0: +                del char[c] +            break +    else: +        flag = False +if flag == True: