#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
const long long INF = std::numeric_limits<long long>::max();
const int MX = 100101;
const long double PI =
    3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798214808651328230664709384460955058223172535940812848111745028410270L;
template <typename T>
pair<T, T> operator+(const pair<T, T> &a, const pair<T, T> &b) {
  return pair<T, T>(a.first + b.first, a.second + b.second);
}
template <typename T>
pair<T, T> operator-(const pair<T, T> &a, const pair<T, T> &b) {
  return pair<T, T>(a.first - b.first, a.second - b.second);
}
template <typename T>
T operator*(const pair<T, T> &a, const pair<T, T> &b) {
  return (a.first * b.first + a.second * b.second);
}
template <typename T>
T operator^(const pair<T, T> &a, const pair<T, T> &b) {
  return (a.first * b.second - a.second * b.first);
}
const int lg = 20;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int N, Q;
  cin >> N >> Q;
  vector<int> sk(N);
  for (int i = 0; i < N; ++i) cin >> sk[i];
  vector<vector<int> > last(N + 1, vector<int>(lg, MOD));
  for (int i = 0; i < lg; ++i) {
    int curr = MOD;
    for (int j = N - 1; j >= 0; --j) {
      last[j][i] = curr;
      if (sk[j] & (1 << i)) curr = j;
    }
  }
  vector<vector<int> > dp(N + 1, vector<int>(lg, MOD));
  for (int i = 0; i < lg; ++i) {
    for (int j = N - 1; j >= 0; j--) {
      dp[j][i] = MOD;
      if (sk[j] & (1 << i)) {
        dp[j][i] = j;
        continue;
      }
      for (int k = 0; k < lg; ++k) {
        if (sk[j] & (1 << k) and last[j][k] != MOD)
          dp[j][i] = min(dp[j][i], dp[last[j][k]][i]);
      }
    }
  }
  int a, b;
  for (int i = 0; i < Q; ++i) {
    cin >> a >> b;
    a--;
    b--;
    bool good = false;
    for (int j = 0; j < lg; ++j) {
      if (sk[b] & (1 << j) and dp[a][j] <= b) {
        good = true;
        break;
      }
    }
    printf(good ? "Shi\n" : "Fou\n");
  }
}
