#include "bits/stdc++.h"
#define in std::cin
#define out std::cout
#define rep(i,N) for(int i=0;i<N;++i)
typedef long long int LL;

int H, W;
std::string a[112];
int cou[112];
std::string field[112];

int main()
{
	in >> H >> W;
	rep(i, H)
	{
		in >> a[i];
		field[i].resize(W + 1);
	}

	rep(i, H)
	{
		for (auto c : a[i]) { ++cou[c - 'a']; }
	}
	rep(i, H)
	{
		rep(j, W)
		{
			if (field[i][j] == '\0')
			{
				bool ok = false;
				std::set<std::pair<int, int>>list;
				list.insert(std::make_pair(i, j));
				list.insert(std::make_pair(H - 1 - i, j));
				list.insert(std::make_pair(i, W - 1 - j));
				list.insert(std::make_pair(H - 1 - i, W - 1 - j));
				int need = (signed)list.size();
				if (need == 0) { out << "WA" << std::endl; return 0; }
				for (char c = 'a'; c <= 'z'; ++c)
				{
					if (cou[c - 'a'] >= need)
					{
						ok = true;
						cou[c - 'a'] -= need;
						field[i][j] = c;
						field[H - 1 - i][j] = c;
						field[i][W - 1 - j] = c;
						field[H - 1 - i][W - 1 - j] = c;
						break;
					}
				}
				if (!ok)
				{
					out << "No" << std::endl;
					return 0;
				}
			}
		}
	}
	out << "Yes" << std::endl;
	return 0;
}
