#include using namespace std; int h, w; char c[205][205]; int main(void) { cin >> h >> w; int ocnt = 0, ecnt = 0; for(int i = 0; i < h; i++){ for(int j = 0; j < w; j++){ char c; cin >> c; if(c == 'o'){ if((j-1-i+w)%2) ocnt++; else ecnt++; } } } if(ocnt == ecnt) cout << "YES" << endl; else cout << "NO" << endl; return 0; }