n,m=list(map(int,input().split())) s=[input() for i in range(n)] hoge=False for ss in s: if ss.count("LOVE")>0: print("YES") hoge=True break if not hoge: print("NO")