from sys import stdin def main(): N, M = map(int, input().split()) S = stdin.read().splitlines() for s in S: if 'LOVE' in s: print('YES') break else: print('NO') main()