n,m=map(int,input().split()) b=str("") for i in range(n): b=b+str(input()) if ('LOVE' in b)==True: print('YES') else: print('NO')