#C6159. Photo Album Creation

    ID: 49888 Type: Default 1000ms 256MiB

Photo Album Creation

Photo Album Creation

You are given a collection of photos. Each photo has a resolution and an identifier. Your task is to determine whether it is possible to organize these photos into an album such that the photos, when sorted by their resolution, have all distinct resolutions. In other words, if any two photos have the same resolution, then the album cannot be created.

The list of identifiers is provided but does not affect the album formation process. The main check is to ensure that all resolution values are unique.

Input Format: The input is given via standard input.

Output Format: Print YES if the album can be created (i.e. all resolutions are unique) or NO otherwise.

inputFormat

The input is given through standard input in three lines:

  • The first line contains a single integer n representing the number of photos.
  • The second line contains n space-separated integers, where each integer represents the resolution of a photo.
  • The third line contains n space-separated integers, where each integer represents the identifier of a photo (this data is not used in forming the album).

outputFormat

Output a single line via standard output. Print YES if all resolutions are unique. Otherwise, print NO.

## sample
5
4 3 2 1 5
10 20 30 40 50
YES