220_A. Little Elephant and Problem_28611
The Little Elephant has got a problem — somebody has been touching his sorted by non-decreasing array a of length n and possibly swapped some elements of the array.

The Little Elephant doesn't want to call the police until he understands if he could have accidentally changed the array himself. He thinks that he could have accidentally changed array a, only if array a can be sorted in no more than one operation of swapping elements (not necessarily adjacent). That is, the Little Elephant could have accidentally swapped some two elements.

Help the Little Elephant, determine if he could have accidentally changed the array a, sorted by non-decreasing, himself.

Input

The first line contains a single integer n (2 ≤ n ≤ 105) — the size of array a. The next line contains n positive integers, separated by single spaces and not exceeding 109, — array a.

Note that the elements of the array are not necessarily distinct numbers.

Output

In a single line print "YES" (without the quotes) if the Little Elephant could have accidentally changed the array himself, and "NO" (without the quotes) otherwise.

Examples

Input

2
1 2


Output

YES


Input

3
3 2 1


Output

YES


Input

4
4 3 2 1


Output

NO

Note

In the first sample the array has already been sorted, so to sort it, we need 0 swap operations, that is not more than 1. Thus, the answer is "YES".

In the second sample we can sort the array if we swap elements 1 and 3, so we need 1 swap operation to sort the array. Thus, the answer is "YES".

In the third sample we can't sort the array in more than one swap operation, so the answer is "NO".
n = input ();
a = map (int, raw_input().split());
b = sorted (a);
cnt = 0;
for i in xrange (n):
	if a[i] != b[i]:
		cnt += 1;
if cnt > 2:
	print 'NO'
else:
	print 'YES';

4
4 3 2 1
 2
1 2
 3
3 2 1
 5
1 4 3 2 1
 6
3 4 5 6 7 2
 3
1 3 2
 50
6 7 8 4 10 3 2 7 1 3 10 3 4 7 2 3 7 4 10 6 8 10 9 6 5 10 9 6 1 8 9 4 3 7 3 10 5 3 10 1 6 10 6 7 10 7 1 5 9 5
 3
2 3 1
 5
1 1 3 2 2
 5
1 4 5 2 3
 5
100 5 6 10 7
 5
1 2 5 3 4
 5
1 3 2 3 3
 20
38205814 119727790 127848638 189351562 742927936 284688399 318826601 326499046 387938139 395996609 494453625 551393005 561264192 573569187 600766727 606718722 730549586 261502770 751513115 943272321
 6
1 2 3 4 5 3
 2
1 1
 5
3 3 1 5 4
 5
1 3 3 2 2
 4
3 2 2 4
 11
2 2 2 2 2 2 2 2 2 2 1
 6
6 1 2 3 4 5
 5
2 3 4 5 1
 2
2 1
 6
1 6 2 4 3 5
 4
3 2 1 1
 4
3 3 2 2
 5
2 2 1 3 3
 4
3 4 1 2
 4
1 2 1 2
 5
4 4 1 1 1
 3
2 1 1
 5
1 4 2 2 3
 4
4 2 1 3
 4
5 12 12 6
 9
7 7 8 8 10 10 10 10 1000000000
 6
2 2 2 2 3 2
 4
2 1 1 1
 10
1 2 4 4 4 5 5 7 7 10
 4
2 4 1 5
 9
3 3 3 2 2 2 1 1 1
 8
3 6 6 6 6 6 4 9
 4
4 1 2 3
 9
1 2 3 5 4 6 7 8 9
 4
1000000000 1 1000000000 1
 8
5 5 5 5 5 5 1 1
 6
1 4 3 6 2 5
 5
4 1 1 1 1
 10
4 4 4 4 10 4 4 4 4 4
 6
4 5 3 4 2 6
 5
3 3 3 2 2
 9
1 8 7 7 7 7 7 8 3
 4
2 2 2 1
 5
1 2 1 1 2
 5
5 1 2 3 4
 11
1 2 3 4 5 1 2 3 4 5 1
 6
1 2 3 1 2 3
 3
3 1 2
 5
1 2 2 1 2
 4
2 2 1 1
 7
3 2 1 2 3 5 4
 100
3 7 7 8 15 25 26 31 37 41 43 43 46 64 65 82 94 102 102 103 107 124 125 131 140 145 146 150 151 160 160 161 162 165 169 175 182 191 201 211 214 216 218 304 224 229 236 241 244 249 252 269 270 271 273 289 285 295 222 307 312 317 319 319 320 321 325 330 340 341 345 347 354 356 366 366 375 376 380 383 386 398 401 407 414 417 423 426 431 438 440 444 446 454 457 458 458 466 466 472
 5
1 5 4 4 4
 47
6 277 329 393 410 432 434 505 529 545 650 896 949 1053 1543 1554 1599 1648 1927 1976 1998 2141 2248 2384 2542 2638 2995 3155 3216 3355 3409 3597 3851 3940 4169 4176 4378 4378 4425 4490 4627 4986 5025 5033 5374 5453 5644
 6
6 1 2 3 4 2
 5
1 3 3 3 2
 5
1 2 7 3 5
 10
4 5 11 12 13 14 16 16 16 18
 4
4 4 3 3
 4
4 5 1 1
 10
1 2 9 4 5 6 7 8 3 10
 128
1 2 4 6 8 17 20 20 23 33 43 49 49 49 52 73 74 75 82 84 85 87 90 91 102 103 104 105 111 111 401 142 142 152 155 160 175 176 178 181 183 184 187 188 191 193 326 202 202 214 224 225 236 239 240 243 246 247 249 249 257 257 261 264 265 271 277 281 284 284 286 289 290 296 297 303 305 307 307 317 318 320 322 200 332 342 393 349 350 350 369 375 381 381 385 385 387 393 347 397 398 115 402 407 407 408 410 411 411 416 423 426 429 429 430 440 447 449 463 464 466 471 473 480 480 483 497 503
 5
1 4 3 3 1
 6
3 4 5 6 9 2
 3
0 3 2
 50
6 7 8 4 10 3 2 7 1 3 10 3 4 7 2 3 7 4 10 6 8 10 9 3 5 10 9 6 1 8 9 4 3 7 3 10 5 3 10 1 6 10 6 7 10 7 1 5 9 5
 3
2 6 1
 5
1 1 3 2 1
 5
1 8 5 2 3
 5
100 5 9 10 7
 5
2 2 5 3 4
 5
2 3 2 3 3
 20
38205814 119727790 127848638 189351562 1085863511 284688399 318826601 326499046 387938139 395996609 494453625 551393005 561264192 573569187 600766727 606718722 730549586 261502770 751513115 943272321
 6
1 2 3 4 5 1
 2
1 0
 5
3 0 1 5 4
 5
1 3 3 2 3
 4
1 2 2 4
 11
2 2 2 3 2 2 2 2 2 2 1
 6
6 1 4 3 4 5
 5
0 3 4 5 1
 2
2 0
 6
1 6 2 0 3 5
 4
6 2 1 1
 4
3 2 2 2
 5
2 2 0 3 3
 4
3 4 0 2
 4
1 2 1 3
 5
4 4 2 1 1
 3
2 2 1
 5
1 5 2 2 3
 4
4 4 1 3
 4
5 12 12 10
 9
7 7 8 8 10 17 10 10 1000000000
 6
2 2 2 1 3 2
 4
2 0 1 1
 10
1 2 1 4 4 5 5 7 7 10
 4
4 4 1 5
 9
3 3 3 1 2 2 1 1 1
 8
6 6 6 6 6 6 4 9
 4
4 1 3 3
 9
1 2 3 5 4 6 7 8 10
 4
1000000000 0 1000000000 1
 8
5 5 0 5 5 5 1 1
 6
1 7 3 6 2 5
 5
4 1 2 1 1
 10
4 4 0 4 10 4 4 4 4 4
 6
4 5 1 4 2 6
 5
3 3 3 0 2
 9
1 1 7 7 7 7 7 8 3
 5
1 2 1 0 2
 5
5 2 2 3 4
 11
1 2 3 4 5 1 2 3 4 3 1
 6
1 0 3 1 2 3
 3
3 2 2
 5
0 2 2 1 2
 4
0 2 2 1
 7
3 3 1 2 3 5 4
 100
3 7 7 8 15 25 26 31 37 41 43 43 46 64 65 82 94 102 102 103 107 124 125 131 140 145 146 150 151 160 160 161 162 165 169 175 182 191 201 211 214 216 218 304 406 229 236 241 244 249 252 269 270 271 273 289 285 295 222 307 312 317 319 319 320 321 325 330 340 341 345 347 354 356 366 366 375 376 380 383 386 398 401 407 414 417 423 426 431 438 440 444 446 454 457 458 458 466 466 472
 5
2 5 4 4 4
 47
6 277 329 28 410 432 434 505 529 545 650 896 949 1053 1543 1554 1599 1648 1927 1976 1998 2141 2248 2384 2542 2638 2995 3155 3216 3355 3409 3597 3851 3940 4169 4176 4378 4378 4425 4490 4627 4986 5025 5033 5374 5453 5644
 5
1 3 4 3 2
 5
1 2 7 1 5
 10
4 5 11 12 13 14 16 16 16 27
 4
4 5 3 3
 4
4 5 1 0
 10
1 2 9 4 5 6 7 8 3 14
 128
1 2 4 6 8 17 20 20 23 33 43 49 49 49 52 73 74 75 82 84 85 87 90 91 102 103 104 105 111 111 401 142 142 152 155 160 175 176 178 181 183 184 187 188 191 193 326 202 202 214 224 225 236 239 240 243 246 247 249 278 257 257 261 264 265 271 277 281 284 284 286 289 290 296 297 303 305 307 307 317 318 320 322 200 332 342 393 349 350 350 369 375 381 381 385 385 387 393 347 397 398 115 402 407 407 408 410 411 411 416 423 426 429 429 430 440 447 449 463 464 466 471 473 480 480 483 497 503
 4
0 3 2 1
 2
2 2
 3
3 0 1
 5
1 4 3 0 1
 6
4 4 5 6 9 2
 3
0 3 0
 50
6 7 8 4 10 3 2 7 1 1 10 3 4 7 2 3 7 4 10 6 8 10 9 3 5 10 9 6 1 8 9 4 3 7 3 10 5 3 10 1 6 10 6 7 10 7 1 5 9 5
 3
4 3 1
 5
1 1 3 0 1
 5
0 8 5 2 3
 5
100 5 1 10 7
 5
3 2 5 3 4
 5
2 3 0 3 3
 20
38205814 195654691 127848638 189351562 1085863511 284688399 318826601 326499046 387938139 395996609 494453625 551393005 561264192 573569187 600766727 606718722 730549586 261502770 751513115 943272321
 6
1 2 1 4 5 1
 2
0 0
 5
3 0 1 5 2
 5
1 4 3 2 3
 4
1 4 2 4
 11
2 2 2 3 2 2 2 2 2 1 1
 6
6 1 4 3 4 8
 5
0 1 4 5 1
 6
1 6 2 0 0 5
 4
6 2 1 2
 4
3 2 1 2
 5
2 3 0 6 3
 4
2 4 0 2
 4
1 2 1 5
 5
4 5 2 1 1
 3
1 2 1

NO
 YES
 YES
 NO
 NO
 YES
 NO
 NO
 YES
 NO
 NO
 NO
 YES
 YES
 NO
 YES
 NO
 NO
 YES
 YES
 NO
 NO
 YES
 NO
 NO
 NO
 YES
 NO
 YES
 NO
 YES
 NO
 NO
 YES
 YES
 YES
 YES
 YES
 NO
 NO
 YES
 NO
 YES
 YES
 NO
 NO
 YES
 YES
 NO
 NO
 YES
 YES
 YES
 NO
 NO
 NO
 NO
 YES
 NO
 NO
 NO
 YES
 YES
 NO
 YES
 NO
 YES
 NO
 NO
 YES
 NO
 YES
 NO
 YES
 NO
 NO
 YES
 NO
 NO
 NO
 YES
 NO
 NO
 YES
 NO
 YES
 YES
 NO
 NO
 NO
 YES
 NO
 NO
 YES
 YES
 NO
 YES
 NO
 YES
 NO
 NO
 YES
 YES
 NO
 NO
 YES
 YES
 NO
 YES
 NO
 YES
 NO
 NO
 NO
 NO
 NO
 NO
 NO
 NO
 NO
 NO
 NO
 NO
 YES
 YES
 YES
 NO
 NO
 YES
 NO
 NO
 NO
 YES
 NO
 NO
 YES
 NO
 YES
 YES
 NO
 NO
 NO
 YES
 NO
 YES
 NO
 NO
 NO
 NO
 NO
 NO
 NO
 YES
 NO
 NO
 YES
 NO
 NO
 NO
 NO
 NO
 NO
 NO
 NO
 YES
 NO
 YES
