# use strict; # use warnings; chomp(my $x = <>); my $N = (split(/ /, $x))[0]; my @c = 1 .. $N; if ($N != 1) { chomp(my $y = <>); my @As = split(/ /, $y); foreach (@As) { unshift(@c, splice(@c, $_ - 1, 1)); } } print($c[0], "\n");