class FibonacciNumbers {

  public int getRecursiveWithCatching(int n) {
    validateInput(n);

    if (n <= 1) {
      return 1;
    } else if (elements[n] != 0) {
      return elements[n];
    }
    elements[n] = getRecursiveWithCatching(n - 1) + getRecursiveWithCatching(n - 2);
    return elements[n];
  }

}