#include<bits/stdc++.h>
    using namespace std;
    #include <ext/pb_ds/assoc_container.hpp>
    #include <ext/pb_ds/tree_policy.hpp>
    using namespace __gnu_pbds;
    template <typename T>
    using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

    #define LOCAL 0

    #define length(a) (sizeof(a)/sizeof(a[0]))
    #define print(v,i,x) for(int j=i;j<=x;j++){cout<<v[j]<<" ";}cout<<endl;
    #define pb push_back
    #define mp make_pair
    #define lli long long int
    #define ulli unsigned long long int
    #define all(x) x.begin(),x.end()
    #define f first
    #define s second

    #define si(x) scanf("%d",&x)
    #define sli(x) scanf("%ld",&x)
    #define slli(x) scanf("%lld",&x)
    #define si2(x,y) {si(x);si(y);}
    #define si3(x,y,z) {si(x);si(y);si(z);}
    #define slli2(x,y) {slli(x);slli(y);}
    #define slli3(x,y,z) {slli(x);slli(y);slli(z);}

    #define pi(x) printf("%d",x)
    #define pi2(x,y) printf("%d %d",x,y)
    #define pi3(x,y,z) printf("%d %d %d",x,y,z)
    #define pli(x) printf("%ld",x)
    #define plli(x) printf("%lld",x)
    #define plli2(x,y) printf("%lld %lld",x,y)
    #define plli3(x,y,z) printf("%lld %lld %lld",x,y,z)
    #define pn printf("\n")
    #define ps printf(" ")
    #define pc(c) printf("%c",c)
    #define pstr(s) printf("%s",s)

    #define FOR(i,x,n) for(int i=x;i<=n;i++)
    #define FORl(i,x,n) for(lli i=x;i<=n;i++)
    #define ROF(i,x,n) for(int i=x;i>=n;i--)
    #define ROFl(i,x,n) for(lli i=x;i>=n;i--)

    #define debug(x) cout << "  - " << #x << ": " << x << endl;
    #define debugs(x, y) cout << "  - " << #x << ": " << x << "         " << #y << ": " << y << endl;
    #define debugss(x, y, z) cout << "  - " << #x << ": " << x << "         " << #y << ": " << y << "         " << #z << ": " << z <<  endl;
    #define fastIO 	std::ios::sync_with_stdio(false);cin.tie(NULL);
    #define cut cout<<"------------------------------------------\n";
    #define cut1 cout<<"******************************************\n";

    typedef vector<int> vi;
    typedef vector<long long> vlli;
    typedef vector<string> vstr;

    typedef pair<int,int> prii;
    typedef pair<int,lli> prilli;
    typedef pair<lli,int> prllii;
    typedef pair<lli,lli> prllilli;

    const lli mod = 1000000007ll;
    const lli MOD = 1000000009ll;
    const lli INF = LLONG_MAX/10;
    const int inf = INT_MAX/2;

    lli count_bit(lli _x){lli _ret=0;while(_x){if(_x%2==1)_ret++;_x/=2;}return _ret;}
    bool check_bit(lli _mask,lli _i){lli x=1;return (_mask&(x<<_i))==0?false:true;}
    lli set_bit(lli _mask,lli _i){lli x=1;_mask=_mask|(x<<_i);return _mask;}
    lli highest_bit(lli _mask){lli ret=-1;int cnt=0;while(_mask){if(_mask&1)ret=cnt;_mask/=2;cnt++;}return ret;}
    lli powermod(lli _a,lli _b,lli _m=mod){lli _r=1;while(_b){if(_b%2==1)_r=(_r*_a)%_m;_b/=2;_a=(_a*_a)%_m;}return _r;}
    lli power(lli _a,lli _b){lli _r=1;while(_b){if(_b%2==1)_r=(_r*_a);_b/=2;_a=(_a*_a);}return _r;}
    lli add(lli a,lli b,lli m=mod){lli x=a+b;while(x>=m)x-=m;return x;}
    lli sub(lli a,lli b,lli m=mod){lli x=a-b;while(x<0)x+=m;return x;}
    lli mul(lli a,lli b,lli m=mod){lli x=a*b;x%=m;return x;}
    lli gcd(lli a,lli b){while(a&&b)a>b?a%=b:b%=a;return a+b;}
    lli lcm(lli a,lli b){return (max(a,b)/gcd(a,b))*min(a,b);}


    struct cmp{
        bool operator()(pair<prllilli,int> const & l,pair<prllilli,int> const & r){
            if(l.f.s!=r.f.s)
                return l.f.s>r.f.s;
            else
                return l.f.f>r.f.f;
        }
    }myobject;

    int cnt[30],n,m,a[110][110];
    int md[10];
    int main()
    {

        if(LOCAL){
        //    freopen("C:\\Users\\Smit Patel\\Desktop\\C++\\Questions\\IPC\\in01.txt","r",stdin);
            freopen("C:\\Users\\Smit Patel\\Desktop\\C++\\Questions\\IPC\\in10.txt","w",stdout);
        }

        fill(cnt,cnt+30,0);
        fill(md,md+10,0);

        cin>>n>>m;
        string s;
        FOR(i,1,n){
            cin>>s;
            FOR(j,0,s.size()-1)
            cnt[s[j]-'a'+1]++;
        }

        if(n==1 && m==1){
            cout<<"Yes";
            return 0;
        }

        FOR(i,1,26){
            md[4]+=cnt[i]/4;
            cnt[i]%=4;
            md[2]+=cnt[i]/2;
            cnt[i]%=2;
            md[1]+=cnt[i];
        }

        int x=(n/2)*(m/2);
        if(md[4]<x){cout<<"No";return 0;}

        md[4]-=x;
        md[2]+=2*md[4];

        x=0;
        if(n&1)x+=m/2;
        if(m&1)x+=n/2;

        if(md[2]<x){cout<<"No";return 0;}
        md[2]-=x;

        md[1]+=2*md[2];

        if(n&1 && m&1)md[1]--;

        if(md[1]==0)
            cout<<"Yes";
        else
            cout<<"No";

        return 0;
    }


Measured memory_bytes: 256