You are given four digits: N1, N2, N3, and N4. Your task is to determine if these digits can be rearranged to form the sequence of digits "1974". In addition to solving the problem, you must implement file I/O: read input from a file and write output to a file.
Input Format
The input is provided in a file named input.txt in the working directory.
The file contains four space-separated single-digit integers (0–9) on a single line.
Output Format
The program should write to a file named output.txt in the working directory.
The file should contain a single line: YES if the digits can be rearranged to form the sequence "1974", otherwise NO.
Examples
Example 1
Input File input.txt:
text
1 9 7 4
Output File output.txt:
text
YES
Example 2
Input File input.txt:
text
4 1 7 9
Output File output.txt:
text
YES
Example 3
Input File input.txt:
text
2 3 5 1
Output File output.txt:
text
NO
Solution Directory
You should implement the solution in the /app/ directory.