Ispalidrome doubt (my all test cases does not passes)

import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
String str = sc.next();
if(str.length() <= 1 && str.length() <=1000)
{
int left = 0;
int right = str.length()-1;
System.out.print(palindrome(str,left,right));
}
}

public static boolean palindrome(String str,int left,int right)
{
if(right==0 || right == 1)
{
return true;
}
if(str.charAt(left) != str.charAt(right))
{

		return false;
	}
	else
	{
		palindrome(str,left+1,right-1);
		return true;
	}
}

}

Hey @mayanktiwari6957
if(str.length() <= 1 && str.length() <=1000) // remove this condition
also change base Case
if(left>=right){
return true

}
correct code