#include <bits/stdc++.h>
using namespace std;

int main()
{
    int n, m;
    cin >> n >> m;
    string s[n];
    for (auto &i : s)
    {
        cin >> i;
    }
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j + 4 < m; j++)
        {
            if (s[i].substr(j, 4) == "LOVE")
            {
                cout << "YES" << endl;
                return 0;
            }
        }
    }
    cout << "NO" << endl;
    return 0;
}