package algo; import java.util.ArrayList; import java.util.Scanner; import java.util.*; public class sample7 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int m = sc.nextInt(); String a = "NO"; for(int i=0; i < n; i++) { String s = sc.next(); String s2 = "LOVE"; if(s.indexOf("LOVE") != -1) { a = "YES"; System.out.println(a); return; } else { } } System.out.println(a); } }