Failing to pass 2 test cases for "chef and special dishes" from march long challenge.

I tried to solve thisproblem for march long challenge but my solution is failing to pass two test cases. Can anyone tell me what is bug in my code.

Here: CodeChef: Practical coding for everyone

added

        if(l<=1)
            System.out.println("NO");

@nilesh3105

Thank you.