#include"bits/stdc++.h" using namespace std; using ll = long long; using ld = long double; using pii = pair; using pll = pair; #define FOR(k,m,n) for(ll (k)=(m);(k)<(n);(k)++) #define REP(i,n) FOR((i),0,(n)) #define WAITING(str) int str;std::cin>>str; #define DEBUGING(str) cout<< #str << " " str<> H >> W; int cnt = 0; int all = 0; int even = 0; REP(i, H) { string s; cin >> s; REP(j, W) if (s[j] == 'o') { cnt++; int num = (H - 1 - i) + j + 1; all += num; if (num % 2 == 0)even++; } } //cout << all << " " << even << endl; bool res1 = all % 2 == 0 ? even > 0 : cnt - even > 0; bool res2 = (even - (all % 2 == 0 ? 1 : 0)) % 2 == 0; bool res = !(res1 && !res2); cout << (res ? "NO" : "YES") << endl; return 0; }