fn is_valid(s: &str) -> bool