def fermat_prp(n, b):
    """
    Fermat's primality test.
    Input:
        n -- Integer >= 3.  Number to be checked.
        b -- Integer.  Basis for the test.
    Output: True or False.  If True, the number is probably prime; if False,
        it's definitely composite.
    Examples:
    >>> fermat_prp(rpn("38 ! 1 -"), 2)
    True
    >>> fermat_prp(rpn("38 ! 1 +"), 2)
    False
    """
    return pow(b, n - 1, n) == 1
