------
## 最终结论
```python
def check_binary_substring(S: str, N: int) -> bool:
    for X in range(1, N + 1):
        binary_representation = bin(X)[2:]
        if binary_representation not in S:
            return False
    return True
```