#include <bits/stdc++.h>
int n, x, last, ans, max, a[200005];
int main() {
  scanf("%d%d", &n, &last);
  ans = 1;
  max = last;
  a[1] = last;
  for (int i = 2; i <= n; i++) {
    scanf("%d", &x);
    a[i] = x;
    if (x > max) max = x;
    int y = x - last;
    if (y < 0) y = -y;
    if (!y) {
      printf("NO\n");
      return 0;
    }
    if (y != 1) {
      if (ans == 1)
        ans = y;
      else if (y != ans) {
        printf("NO\n");
        return 0;
      }
    }
    last = x;
  }
  if (ans > 1)
    for (int i = 2; i <= n; i++) {
      int y = a[i] - a[i - 1], y1 = a[i - 1] % ans, y2 = a[i] % ans;
      if ((y == 1 && !y1) || (y == -1 && y1 == 1)) {
        printf("NO\n", i);
        return 0;
      }
    }
  printf("YES\n");
  if (max % ans)
    printf("%d ", max / ans + 1);
  else
    printf("%d ", max / ans);
  printf("%d\n", ans);
}
