i would give a try to this code:
res = (df.loc[df["A"]==2].index-1).isin(df.loc[df["A"]==1].index).all()
then print your dataframe bases on boolean value in res.