//#pragma comment(linker, "/STACK:102400000,102400000")
//#include <initializer_list>
#include <fstream>
#include <iostream>
#include <functional>
#include <algorithm>
#include <sstream>
#include <cstring>
#include <vector>
#include <string>
#include <cstdio>
#include <cmath>
#include <queue>
#include <stack>
#include <deque>
#include <ctime>
#include <list>
#include <set>
#include <map>
#include <bitset>
#include <cassert>
//#include <unordered_map>
//#include <unordered_set>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
#define eps 1e-8
#define LL_INF 0x3fffffffffffffff
#define INF 0x3f3f3f3f
#define mem(a, b) memset(a, b, sizeof(a))
#define pper(i,n,m) for(int i = n;i >= m; i--)
#define repp(i, n, m) for (int i = n; i <= m; i++)
#define rep(i, n, m) for (int i = n; i < m; i++)
#define sa(n) scanf("%d", &(n))
#define slla(n) scanf("%lld", &(n))
#define mp make_pair
#define ff first
#define ss second
#define pb push_back
#define DE(val) cout<<#val<<": "<<val<<endl;
#define CASET int ___T, case_n = 1; scanf("%d ", &___T); repp(i,1,___T)

const int dx44[5] = { 0,-1,-1,1,1 };
const int dy44[5] = { 0,-1,1,-1,1 };

const int dx4[5] = { 0,-1,0,1,0 };
const int dy4[5] = { 0,0,1,0,-1 };
const int dx8[9] = { 0,-1,0,1,0,1,1,-1,-1 };
const int dy8[9] = { 0,0,1,0,-1,1,-1,1,-1 };
const int maxn = 2e5 + 5;
const double PI = acos(-1.0);
const ll mod = 1e9 + 7;
ll po(ll a, ll b, ll mod) { ll res = 1; a %= mod; for (; b; b >>= 1) { if (b & 1)res = res*a%mod; a = a*a%mod; }return res; }
ll gcd(ll a, ll b) { if (a == 0) { return b; } else { return gcd(b%a, a); } }
void YES() { puts("YES"); exit(0); }
void Yes() { puts("Yes");}// exit(0); }
void NO() { puts("NO"); exit(0); }
void No() { puts("No");}// exit(0); }
void one() { puts("-1"); exit(0); }

int h,w;
char val[105][105];
int vis[105][105];
char ans[105][105];
int cnt[30];

void solve()
{
    sa(h),sa(w);
    repp(i,1,h)
    {
        scanf("%s",val[i]+1);
        repp(j,1,w)
        {
            cnt[val[i][j]-'a']++;
        }
    }
    repp(i,1,h)
    {
        repp(j,1,w)
        {
            if(vis[i][j])continue;
            set< pair<int,int> >x;
            vis[i][j]=1;
            vis[h-i+1][j]=1;
            vis[i][w-j+1]=1;
            vis[h-i+1][w-j+1]=1;
            x.insert(mp(i,j));
            x.insert(mp(h-i+1,j));
            x.insert(mp(i,w-j+1));
            x.insert(mp(h-i+1,w-j+1));

            if( x.size() == 4)
            {
                int flag = 0;
                rep(k,0,26)
                {
                    if(cnt[k]>=4)
                    {
                        cnt[k] -= 4;
                        flag = 1;
                        ans[i][j] = k+'a';
                        ans[h-i+1][j] = k+'a';
                        ans[i][w-j+1] = k+'a';
                        ans[h-i+1][w-j+1] = k+'a';
                        break;
                    }
                }

                if(flag == 0)
                {

                    puts("No");
                    return;
                }
            }
            else if(x.size()==2)
            {
                int flag = 0;
                rep(k,0,26)
                {
                    if(cnt[k]%4 == 2)
                    {
                        cnt[k] -= 2;
                        flag = 1;
                        ans[i][j] = k+'a';
                        ans[h-i+1][j] = k+'a';
                        ans[i][w-j+1] = k+'a';
                        ans[h-i+1][w-j+1] = k+'a';break;
                    }
                }

                if(flag == 0)
                {
                    rep(k,0,26)
                    {
                        if(cnt[k]>=2)
                        {
                            cnt[k] -= 2;
                            flag = 1;
                            ans[i][j] = k+'a';
                            ans[h-i+1][j] = k+'a';
                            ans[i][w-j+1] = k+'a';
                            ans[h-i+1][w-j+1] = k+'a';break;
                        }
                    }
                    if(flag == 0)
                    {
                        puts("No");
                        return;
                    }
                }
            }
            else
            {
                int flag = 0;
                rep(k,0,26)
                {
                    if(cnt[k]&1)
                    {
                        cnt[k] -= 1;
                        flag = 1;
                        ans[i][j] = k+'a';
                        ans[h-i+1][j] = k+'a';
                        ans[i][w-j+1] = k+'a';
                        ans[h-i+1][w-j+1] = k+'a';break;
                    }
                }

                if(flag == 0)
                {
                    rep(k,0,26)
                    {
                        if(cnt[k]>=2&&cnt[k]<4)
                        {
                            cnt[k] -= 1;
                            flag = 1;
                            ans[i][j] = k+'a';
                            ans[h-i+1][j] = k+'a';
                            ans[i][w-j+1] = k+'a';
                            ans[h-i+1][w-j+1] = k+'a';break;
                        }
                    }
                    if(flag == 0)
                    {
                       rep(k,0,26)
                        {
                            if(cnt[k]>=4)
                            {
                                cnt[k] -= 1;
                                flag = 1;
                                ans[i][j] = k+'a';
                                ans[h-i+1][j] = k+'a';
                                ans[i][w-j+1] = k+'a';
                                ans[h-i+1][w-j+1] = k+'a';break;
                            }
                        }
                        if(flag == 0)
                        {
                            puts("No");
                            return;
                        }
                    }
                }
            }
        }
    }
    puts("Yes");
}

int main()
{
    solve();
    // system("pause");
    return 0;
}

Measured memory_bytes: 256