This Java class will take three command line arguments in the following order: an adjacency list input file, a prereq input file and an output file.The adjacency list input file will be formatted exactly as the one from AdjList.The prereq input file will be formatted as follows:1 line containing the ID for course 11 line containing the ID for course 2You will use the graph described by the adjacency list input file to answer the following question about the courses: If course 2 was an immediate prerequisite for course 1, would all courses still be possible to take? (Remember, a course can only be taken once all its immediate prerequisites have been met). For example, adding cs111 as a prerequisite to cs211 is redundant, but doesn’t cause any problems and all courses are still possible to take. Adding cs211 as a prerequisite to cs111 creates a situation where you cannot take cs111 OR cs211 OR anything in between, so all courses are no longer possible to take.The output file will be formatted as follows:One line, containing either "YES" or "NO". "YES" if all courses are still possible to take for a new student, and "NO" otherwise.Here is the correct "validprereq.out" file obtained from running the ValidPrereq.java file with the command line arguments "adjlist.in", "validprereq.in", and "validprereq.out" in that order.-------------------------------------ValidPreReq.java Code------------------------------------- package prereqchecker;/** * Steps to implement this class main method: * *Step 1: * AdjListInputFile name is passed through the command line as args[0] * Read from AdjListInputFile with the format: * 1. a (int): number of courses in the graph * 2. a lines, each with 1 course ID * 3. b (int): number of edges in the graph * 4. b lines, each with a source ID ** Step 2: * ValidPreReqInputFile name is passed through the command line as args[1] * Read from ValidPreReqInputFile with the format: * 1. 1 line containing the proposed advanced course * 2. 1 line containing the proposed prereq to the advanced course * *Step 3: * ValidPreReqOutputFile name is passed through the command line as args[2] * Output to ValidPreReqOutputFile with the format: * 1. 1 line, containing either the word "YES" or "NO" */ public class ValidPrereq { public static void main(String[] args) { if ( args.length < 3 ) { StdOut.println("Execute: java -cp bin prereqchecker.ValidPrereq ");return; }// WRITE YOUR CODE HERE } }