#K59252. Event Capacity Verification

    ID: 30823 Type: Default 1000ms 256MiB

Event Capacity Verification

Event Capacity Verification

You are given N employees and M activities. Each activity has a maximum capacity and each employee has a specific interest in one of the activities. Determine whether it is possible to organize the event such that for every activity i, the number of employees interested in that activity does not exceed its capacity. In other words, if \( c_i \) represents the capacity of activity \( i \) and \( a_i \) is the number of employees interested in that activity, then the event can be organized if and only if \( a_i \leq c_i \) for all \( i \).

The input is provided via standard input and the output should be printed to standard output.

inputFormat

The first line contains two integers \(N\) and \(M\) denoting the number of employees and the number of activities respectively. The second line contains \(M\) integers, representing the capacities of the activities. The third line contains \(N\) integers, where each integer is between 1 and \(M\) (inclusive) representing the activity that the corresponding employee is interested in. If \(N=0\), the third line will be empty.

outputFormat

Output a single line with the word Possible if it is possible to organize the event without exceeding any activity's capacity; otherwise, output Impossible.

## sample
5 3
2 1 3
1 1 2 3 3
Possible