#include <iostream>
#include <vector>
#include <math.h>
#include <cmath>
#include <algorithm>
#include <string>
#include <cstring>
#include <regex>

using namespace std;

using ll = long long;
using pii = pair<int,int>;
using vi = vector<int>;
using vvi = vector<vi>;
using vs = vector<string>;
using vvs = vector<vs>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vpii = vector<pii>;
using vvpii = vector<vpii>;

#define fi first
#define se second
#define mp make_pair
#define pb push_back

#define FOR(i,a,b) for(int i=(a);i<=(b);i++)
#define rFOR(i,a,b) for(int i=(b);i>=(a);i--)
#define SORT(a) sort((a).begin(),(a).end());
#define rSORT(a) sort((a).rbegin(),(a).rend());
#define UNIQUE(a) (a).erase(unique((a).begin(),(a).end()),(a).end());
#define yn(a) cout <<((a)?"yes":"no")<<endl;
#define Yn(a) cout <<((a)?"Yes":"No")<<endl;
#define YN(a) cout <<((a)?"YES":"NO")<<endl;
#define Say(a) cout <<(a);
#define Sal(a) cout <<(a)<<endl;

const ll MOD = 1e9+7;
const string alp = "abcdefghijklmnopqrstuvwxyz";
const string ALP = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";

//sankou
//vvi = vector<vector<int>>(20, vector<int>(10, 0));

//seiki
//#include <regex>
/*bubun*/
//regex_search("u32", regex("[0-9]"));      // true
/*kanzen*/
//regex_match("u32", regex("(i|u)\\d+"));   // true

int isP(int n) {
    if(n<=1) return 0;
    FOR(i,2,(int)sqrt(n)) {
        if(n%i==0) return 0;
    }
    return 1;
}

int main() {

    int H,W,chd=0,can=1;
    cin >>H>>W;
    vs a(H);
    vector<pair<char,int>> als;
    FOR(i,0,H-1){
        cin >>a[i];
        FOR(k,0,W-1){
            if(als.size()>0) {
                FOR(j,0,als.size()-1){
                    if(als[j].fi==a[i][k]) {
                        als[j].se++;
                        chd=1;
                    }
                }
                if(chd==0) als.pb(mp(a[i][k],1));
                chd=0;
            }
            if(als.size()==0) als.pb(mp(a[i][k],1));
        }
    }
    
    if((H>1)&&(W>1)) {
        if((H%2==0)&&(W%2==0)) {
            FOR(i,0,als.size()-1){
                if(als[i].se%4!=0) {
                    can=0;
                    break;
                }
            }
        }
    
        if((H%2==1)&&(W%2==0)) {
            int twocnt=0;
            int fourcnt=0;
            FOR(i,0,als.size()-1){
                if(als[i].se%2==1) {
                    can=0;
                    break;
                }
                if(als[i].se%2==0) {
                    if(als[i].se>=4) {
                        fourcnt++;
                    }
                    if(als[i].se%4==2) {
                        twocnt++;
                        if(twocnt>(W/2)) {
                            can=0;
                            break;
                        }
                    }
                }
            }
            if(fourcnt==0) can=0;
        }
        
        if((H%2==0)&&(W%2==1)) {
            int twocnt=0;
            int fourcnt=0;
            FOR(i,0,als.size()-1){
                if(als[i].se%2==1) {
                    can=0;
                    break;
                }
                if(als[i].se%2==0) {
                    if(als[i].se>=4) {
                        fourcnt++;
                    }
                    if(als[i].se%4==2) {
                        twocnt++;
                        if(twocnt>(H/2)) {
                            can=0;
                            break;
                        }
                    }
                }
            }
            if(fourcnt==0) can=0;
        }
        
        if((H%2==1)&&(W%2==1)) {
            int oddcnt=0;
            int twocnt=0;
            int fourcnt=0;
            FOR(i,0,als.size()-1){
                if(als[i].se%2==1) {
                    oddcnt++;
                    if(oddcnt>1) {
                        can=0;
                        break;
                    }
                }
                if(als[i].se%2==0) {
                    if(als[i].se>=4) {
                        fourcnt++;
                    }
                    if(als[i].se%4==2) {
                        twocnt++;
                        if(twocnt>((H+W-2)/2)) {
                            can=0;
                            break;
                        }
                    }
                }
            }
            if(fourcnt==0) can=0;
        }
    }
    
    if((H==1)&&(W%2==0)){
        int oddcnt=0;
        FOR(i,0,als.size()-1){
            if(als[i].se%2==1) {
                can=0;
                break;
            }
        }
    }
    
    if((H==1)&&(W%2==1)){
        int oddcnt=0;
        FOR(i,0,als.size()-1){
            if(als[i].se%2==1) {
                oddcnt++;
                if(oddcnt>1) {
                    can=0;
                    break;
                }
            }
        }
    }
    
    if((H%2==0)&&(W==1)){
        int oddcnt=0;
        FOR(i,0,als.size()-1){
            if(als[i].se%2==1) {
                can=0;
                break;
            }
        }
    }
    
    if((H%2==1)&&(W==1)){
        int oddcnt=0;
        FOR(i,0,als.size()-1){
            if(als[i].se%2==1) {
                oddcnt++;
                if(oddcnt>1) {
                    can=0;
                    break;
                }
            }
        }
    }
    
    Yn(can);
    
    return 0;
}

Measured memory_bytes: 256