/*
    AUTHOR:hruday pabbisetty
    NIT ROURKElA
    MALDGPXXQL6F9LR
*/
#include <bits/stdc++.h>
#include <tr1/unordered_map>
using namespace std;
#define opt ios_base::sync_with_stdio(0)
#define lli long long int
#define ulli unsigned long long int
#define I int
#define S string
#define D double
#define rep(i,a,b) for(i=a;i<b;i++)
#define repr(i,a,b) for(i=a;i>b;i--)
#define in(n) scanf("%lld",&n)
#define in2(a,b) scanf("%lld %lld",&a,&b)
#define in3(a,b,c) scanf("%lld %lld %lld",&a,&b,&c)
#define out(n) printf("%lld\n",n)
#define inu(a) scanf("%lld",&a)
#define outu(a) printf("%llu",a)
#define ins(s) scanf("%s",&s)
#define outs(s) printf("%s",s)
#define nl printf("\n")
#define mod 1000000007
#define inf 100000000000000
typedef long long       ll;
typedef pair<lli,lli>  plli;
typedef vector<lli>     vlli;
typedef vector<ulli>    vulli;
typedef vector<ll>      vll;
typedef vector<string>  vs;
typedef vector<plli>     vplli;
#define MM(a,x)  memset(a,x,sizeof(a));
#define ALL(x)   (x).begin(), (x).end()
#define P(x)       cerr<<"{"#x<<" = "<<(x)<<"}"<<endl;
#define P2(x,y)       cerr<<"{"#x" = "<<(x)<<", "#y" = "<<(y)<<"}"<<endl;
#define P3(x,y,z)  cerr<<"{"#x" = "<<(x)<<", "#y" = "<<(y)<<", "#z" = "<<(z)<<"}"<<endl;
#define P4(x,y,z,w)cerr<<"{"#x" = "<<(x)<<", "#y" = "<<(y)<<", "#z" = "<<(z)<<", "#w" = "<<(w)<<"}"<<endl;
#define PP(x,i)     cerr<<"{"#x"["<<i<<"] = "<<x[i]<<"}"<<endl;
#define TM(a,b)     cerr<<"{"#a" -> "#b": "<<1000*(b-a)/CLOCKS_PER_SEC<<"ms}\n";
#define UN(v)    sort(ALL(v)), v.resize(unique(ALL(v))-v.begin())
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define sz() size()
//#define nl cout<<"\n"
#define MX1 100005
#define MX2 1000005
#define sqr(a) a*a*a
#define bs binary_search
#define lb lower_bound
#define ub upper_bound

lli power(lli a,lli b)
    {
    lli value;
    if(b==0)
        {
        return 1;
    }
    else if(b%2==0)
        {
        value=power(a,b/2)%mod;
        return(value*value)%mod;
    }
    else
        {
        value=power(a,b/2)%mod;
        return ((a*value)%mod*(value))%mod;
    }
}
int main()
{
      /*  #ifndef ONLINE_JUDGE
        freopen("input.txt","r",stdin);
        freopen("output.txt","w",stdout);
        #endif*/
    opt;
    lli n,m;
    cin>>n>>m;
    char ch[n][m];
    lli dp[n][m];
    lli a[26]={0},i,j;
    rep(i,0,n)
    {
        rep(j,0,m)
        {
            dp[i][j]=0;
            cin>>ch[i][j];
            a[ch[i][j]-'a']++;
        }
    }
    lli cnt=1;
    vlli v,v1;
    rep(i,0,n)
    {
        rep(j,0,m)
        {
            if(dp[i][j])
            {
                continue;
            }
            dp[i][j]=cnt;
            dp[i][m-1-j]=cnt;
            dp[n-1-i][j]=cnt;
            dp[n-1-i][m-1-j]=cnt;
            cnt++;
        }
    }
    map<lli,lli>ma;
    rep(i,0,n)
    {
        rep(j,0,m)
        {
            ma[dp[i][j]]++;
        }
    }
    map<lli,lli>:: iterator it;
    lli od=0,tw=0,fo=0;
    lli cnfo=0,cntw=0;
    for(it=ma.begin();it!=ma.end();it++)
    {
        if((it->s)%2)
        {
            od++;
        }
        if(it->s==2)
        {
            tw++;
        }
        else if(it->s==4)
        {
            fo++;
        }
    }
    rep(i,0,26)
    {
        cnfo+=(a[i]/4);
        if(a[i]>4 and a[i]%2==0)
        {
            cntw+=(a[i]%4==2);
        }
    }
    if(cnfo<fo)
    {
        cout<<"No";
        exit(0);
    }
    cnfo-=fo;
    cntw+=2*cnfo;
    rep(i,0,26)
    {
        if(a[i]<4)
        {
            cntw+=a[i]/2;
        }
    }
    if(cntw<tw)
    {
        cout<<"No";
        exit(0);
    }
    if(od>1)
    {
        cout<<"No";
        exit(0);
    }
    rep(i,0,26)
    {
        if(a[i]%2)
        {
            od--;
        }
    }
    if(od)
    {
        cout<<"No";
        exit(0);
    }
    cout<<"Yes";
}



Measured memory_bytes: 512