Lifted Inference beyond First-Order Logic