Buggy python submission (verdict: Runtime Error):
cnt = 0
n = int(input())
p = list(map(int, input().split())
for i in range(n):
  if int(i) + 1 != p[i] :
    cnt += 1
    if cnt >= 3:
      break
if cnt <= 2 :
  print("YES")
else :
   print("NO")


Fixed submission:
cnt = 0
n = int(input())
p = list(map(int, input().split()))
for i in range(1, n + 1):
  if int(i) != p[i - 1] :
    cnt += 1
    if cnt >= 3:
      break
if cnt <= 2 :
  print("YES")
else :
   print("NO")

Buggy python submission (verdict: Runtime Error):
cnt = 0
n = int(input())
p = list(map(int, input().split())
for i in range(1, n + 1):
  if int(i) != p[i - 1] :
    cnt += 1
    if cnt >= 2:
      break
if cnt <= 1 :
  print("YES")
else :
   print("NO")


Fixed submission:
cnt = 0
n = int(input())
p = list(map(int, input().split()))
for i in range(1, n + 1):
  if int(i) != p[i - 1] :
    cnt += 1
    if cnt >= 3:
      break
if cnt <= 2 :
  print("YES")
else :
   print("NO")

Buggy python submission (verdict: Runtime Error):
cnt = 0
n = int(input())
for i in range(1, n + 1):
  p = int(input())
  if int(i) != p :
    cnt += 1
    if cnt >= 2:
      break
if cnt <= 1 :
  print("YES")
else :
   print("NO")


Fixed submission:
cnt = 0
n = int(input())
p = list(map(int, input().split()))
for i in range(1, n + 1):
  if int(i) != p[i - 1] :
    cnt += 1
    if cnt >= 3:
      break
if cnt <= 2 :
  print("YES")
else :
   print("NO")

Buggy python submission (verdict: Runtime Error):
cnt = 0
n = int(input())
for i int range(1, n + 1):
  p = int(input())
  if int(i) != p :
    cnt += 1
    if cnt >= 2:
      break
if cnt <= 1 :
  print("YES")
else :
   print("NO")


Fixed submission:
cnt = 0
n = int(input())
p = list(map(int, input().split()))
for i in range(1, n + 1):
  if int(i) != p[i - 1] :
    cnt += 1
    if cnt >= 3:
      break
if cnt <= 2 :
  print("YES")
else :
   print("NO")

Buggy python submission (verdict: Runtime Error):
cnt = 0
n = int(input())
for i int rangr(1, n + 1):
  p = int(input())
  if int(i) != p :
    cnt += 1
    if cnt >= 2:
      break
if cnt <= 1 :
  print("YES")
else :
   print("NO")


Fixed submission:
cnt = 0
n = int(input())
p = list(map(int, input().split()))
for i in range(1, n + 1):
  if int(i) != p[i - 1] :
    cnt += 1
    if cnt >= 3:
      break
if cnt <= 2 :
  print("YES")
else :
   print("NO")

Buggy python submission (verdict: Runtime Error):
cnt = 0
n = int(input())
for i int rangr(1, n + 1):
  p = map(int, input().split())
  if int(i) != p :
    cnt += 1
    if cnt >= 2:
      break
if cnt <= 1 :
  print("YES")
else :
   print("NO")


Fixed submission:
cnt = 0
n = int(input())
p = list(map(int, input().split()))
for i in range(1, n + 1):
  if int(i) != p[i - 1] :
    cnt += 1
    if cnt >= 3:
      break
if cnt <= 2 :
  print("YES")
else :
   print("NO")

Buggy python submission (verdict: Runtime Error):
cnt = 0
n = int(input())
for i int rangr(1, n + 1):
  p = map(int, input().split()
  if int(i) != p :
    cnt += 1
    if cnt >= 2:
      break
if cnt <= 1 :
  print("YES")
else :
   print("NO")


Fixed submission:
cnt = 0
n = int(input())
p = list(map(int, input().split()))
for i in range(1, n + 1):
  if int(i) != p[i - 1] :
    cnt += 1
    if cnt >= 3:
      break
if cnt <= 2 :
  print("YES")
else :
   print("NO")

Buggy python submission (verdict: Runtime Error):
cnt = 0
n = int(input())
for i int rangr(1, n + 1):
  p = map(int, input().split()
  if int(i) != p :
    cnt += 1
    if cnt >= 2:
      break
if cnt <= 1 :
  print("YES")
else :
   print("NO)

Fixed submission:
cnt = 0
n = int(input())
p = list(map(int, input().split()))
for i in range(1, n + 1):
  if int(i) != p[i - 1] :
    cnt += 1
    if cnt >= 3:
      break
if cnt <= 2 :
  print("YES")
else :
   print("NO")