n,m = map(int, input().split()) ans = 'NO' for _ in range(n): S = input() if 'LOVE' in S: ans = 'YES' print(ans)