Made Sequence abstract and isValid to abstract method.