n, m = map(int, input().split()) white_flag = 0 for i in range(n): white_flag += input().count("LOVE") result= "YES" if white_flag else "NO" print(result)