n,m=map(int,input().split()) s = [input().rsrtip() for _ in range(n)] for x in s: if 'LOVE' in x: print('YES') exit() print('NO')