#include <iostream>

using namespace std;

int main() {
    int h, w;
    cin >> h >> w;
    bool ret = false;
    for (int i = 0; i < h; i++) {
        string s;
        cin >> s;
        for (int j = 0; j < w - 3; j++) {
            if (s.substr(j, 4) == "LOVE")ret = true;
        }
    }
    cout << (ret ? "YES" : "NO") << endl;
    return 0;
}