n,m = map(int,input().split()) L = [] for i in range(n) : s = input() L.append(s) L = ''.join(L) a = L.find("LOVE") if a == -1 : print('NO') else : print("YES")