Security Bijective Functions

  • + 0 comments

    quite hard to understand the question - only really became clear after stumbliing across the right answer - very easy once you get past the wordingof the explanation

    # Enter your code here. Read input from STDIN. Print output to STDOUT
    n = int(input().strip())
    arr = [int(i) for i in input().strip().split()]
    ans = "YES"
    for i in range(1,n+1):
        if i not in arr:
            ans = "NO"
    print(ans)