We are given four digits. Determine if they can be arranged to be exactly the digits of "1974", i.e., exactly one 1, one 9, one 7, one 4. The order doesn't matter; we just need to check that the multiset of digits is exactly {1,9,7,4}. So we can simply read four integers and check if after sorting they equal [1,4,7,9] (in any order). Or check counts: count of 1 == 1, count of 9 ==1, count of 7==1, count of4==1, and no other digits. But note: input could have duplicates, e.g., 1,1,1,1 would be NO. So simplest: sort list and compare to [1,4,7,9]? Actually the required digits are 1,9,7,4. Sorted is 1,4,7,9. So we can sort and check equality. Or just check if set equals {1,4,7,9} and length of list equals 4? Actually if there are duplicates, set size would be less than 4, so we also need to ensure we have exactly one of each. For instance, input 1,1,9,7 would have set {1,9,7} size 3, so not equal. But set equality with {1,4,7,9} would fail because 4 missing. However if input 1,4,7,7, set would be {1,4,7} not full. So set equality alone might not guarantee correct counts? Actually set equality would ensure that all digits are exactly 1,4,7,9, but it wouldn't guarantee each appears exactly once; e.g., if input is 1,1,4,7? That set is {1,4,7} not equal to {1,4,7,9} so fails. Could there be a case where set equals {1,4,7,9} but counts are not exactly one each? If you have 1,1,4,7? Set is missing 9. To have set exactly {1,4,7,9}, you must have at least one of each. But could have extra duplicates of one of them, e.g., 1,1,4,7,9? That's five numbers, but we only have four digits. So with exactly four numbers, if set equals {1,4,7,9} then you have one of each, because you have four items and four distinct values. So the condition that the sorted list equals [1,4,7,9] is sufficient. Alternatively, check if sorted input equals that list.
We'll implement: read four ints, put them in list, sort, compare to [1,4,7,9] (or [1,4,7,9] as sorted). Print "YES" if matches else "NO".
Edge cases: digits may be given with leading zeros? It says digits 0-9. So could be 0, but that won't match anyway.
We'll output exactly "YES" or "NO".
That's it.
But there might be a catch: "sequence of digits '1974'" might refer to the exact order? The problem statement: "Determine if these can be arranged into the sequence of digits '1974'." The phrase "arranged into the sequence" implies we can rearrange them to form that sequence, i.e., we need to check if after rearrangement they can be placed to match exactly the sequence "1974". So it's exactly the multiset condition. So the solution is straightforward.
We'll produce a Python solution.
Now writing the response: Provide a solution in Python.
We need to follow typical structure: read input from stdin, split, map to int, sort, check equality.
Implementation:
def main():
digits = list(map(int, input().split()))
digits.sort()
if digits == [1,4,7,9]:
print("YES")
else:
print("NO")
if name == "main":
main()
We can also use Counter to ensure counts of 1,9,7,4 each ==1.
Alternatively, check if set == {1,4,7,9} and len(digits)==4, but as argued, that's enough.
But let's be safe: because if input is [1,1,1,1] set is {1}, not match. So it's fine.
Thus final answer.
We'll output the code.
We need to include explanation? The user asked "You are given four digits... Determine if these can be arranged..." Typically we just output the code? But they said "You are given..." This is a problem statement. Usually we are to provide a solution. So we should output the code. We might also provide a brief explanation but the answer likely expects code only. In the context, the user is ChatGPT providing answer. Usually we can give a solution in Python.
Thus final. ```python
def main():
# Read four integers, split by whitespace
digits = list(map(int, input().split()))
# Sort the list
digits.sort()
# Compare with the sorted target [1,4,7,9]
if digits == [1, 4, 7, 9]:
print("YES")
else:
print("NO")
if name == "main":
main()